mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Make Linux postinstall more permissive (#3550)
In some installations (observed on GitHub Actions), the postinstall script would fail to start the service because the `systemctl` binary was at a different path than expected, or the `systemd` binary was not found running. This change allows the service to start on these environments.
This commit is contained in:
parent
f20762b431
commit
08ff4e941c
@ -225,10 +225,10 @@ var postInstallTemplate = template.Must(template.New("postinstall").Parse(`
|
||||
set -e
|
||||
|
||||
# If we have a systemd, daemon-reload away now
|
||||
if [ -x /bin/systemctl ] && pidof systemd ; then
|
||||
/bin/systemctl daemon-reload 2>/dev/null 2>&1
|
||||
if which systemctl; then
|
||||
systemctl daemon-reload 2>/dev/null 2>&1
|
||||
{{ if .StartService -}}
|
||||
/bin/systemctl restart orbit.service 2>&1
|
||||
systemctl restart orbit.service 2>&1
|
||||
{{- end}}
|
||||
fi
|
||||
`))
|
||||
|
Loading…
Reference in New Issue
Block a user