Issue #799 Added systemd restart templates
This commit is contained in:
parent
dde83d5a7c
commit
fabe2ffa2f
|
@ -84,6 +84,22 @@ OnCalendar=daily
|
|||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
`,
|
||||
},
|
||||
{
|
||||
Path: "/etc/systemd/system/cloudflared-restart.path",
|
||||
Content: `[Path]
|
||||
PathChanged=/usr/bin/cloudflared
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
`,
|
||||
},
|
||||
{
|
||||
Path: "/etc/systemd/system/cloudflared-restart.service",
|
||||
Content: `[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/systemctl restart cloudflared
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
@ -273,6 +289,10 @@ func installSystemd(templateArgs *ServiceTemplateArgs, log *zerolog.Logger) erro
|
|||
log.Err(err).Msgf("systemctl enable %s error", cloudflaredService)
|
||||
return err
|
||||
}
|
||||
if err := runCommand("systemctl", "enable", "cloudflared-restart.path"); err != nil {
|
||||
log.Err(err).Msg("systemctl enable cloudflared-restart.path error")
|
||||
return err
|
||||
}
|
||||
if err := runCommand("systemctl", "start", "cloudflared-update.timer"); err != nil {
|
||||
log.Err(err).Msg("systemctl start cloudflared-update.timer error")
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue