Skip to content

Commit

Permalink
Ignore sysvinit scripts when systemd is used
Browse files Browse the repository at this point in the history
  • Loading branch information
remicalixte committed Oct 16, 2018
1 parent f4bf618 commit b4367fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions omnibus/package-scripts/agent/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ if [ "$DISTRIBUTION" != "Darwin" ]; then
# Only supports systemd and upstart
echo "Enabling service $SERVICE_NAME"
if command -v systemctl >/dev/null 2>&1; then
systemctl enable $SERVICE_NAME || echo "[ WARNING ]\tCannot enable $SERVICE_NAME with systemctl"
systemctl enable $SERVICE_NAME-process || echo "[ WARNING ]\tCannot enable $SERVICE_NAME-process with systemctl"
systemctl enable $SERVICE_NAME-trace || echo "[ WARNING ]\tCannot enable $SERVICE_NAME-trace with systemctl"
SYSTEMCTL_SKIP_SYSV=true systemctl enable $SERVICE_NAME || echo "[ WARNING ]\tCannot enable $SERVICE_NAME with systemctl"
SYSTEMCTL_SKIP_SYSV=true systemctl enable $SERVICE_NAME-process || echo "[ WARNING ]\tCannot enable $SERVICE_NAME-process with systemctl"
SYSTEMCTL_SKIP_SYSV=true systemctl enable $SERVICE_NAME-trace || echo "[ WARNING ]\tCannot enable $SERVICE_NAME-trace with systemctl"
elif command -v initctl >/dev/null 2>&1; then
# Nothing to do, this is defined directly in the upstart job file
:
Expand Down
6 changes: 3 additions & 3 deletions omnibus/package-scripts/agent/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ deregister_agent()
# Disable agent start on system boot
# Only supports systemd and upstart
if command -v systemctl >/dev/null 2>&1; then
systemctl disable $SERVICE_NAME-process || true
systemctl disable $SERVICE_NAME-trace || true
systemctl disable $SERVICE_NAME || true
SYSTEMCTL_SKIP_SYSV=true systemctl disable $SERVICE_NAME-process || true
SYSTEMCTL_SKIP_SYSV=true systemctl disable $SERVICE_NAME-trace || true
SYSTEMCTL_SKIP_SYSV=true systemctl disable $SERVICE_NAME || true
elif command -v initctl >/dev/null 2>&1; then
# Nothing to do, this is defined directly in the upstart job file
:
Expand Down

0 comments on commit b4367fe

Please sign in to comment.