Skip to content

Commit

Permalink
Fix: systemd: switch from legacy forking to simple service
Browse files Browse the repository at this point in the history
  • Loading branch information
wenningerk committed Jun 16, 2023
1 parent 3ba9640 commit 940ced8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/sbd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ RefuseManualStop=true
RefuseManualStart=true

[Service]
Type=forking
PIDFile=@runstatedir@/sbd.pid
Type=simple
# sbd-inquisitor will usually have opened a watchdog-device
# thus we should give it a chance to do what
# it needs to (anyway kills the subprocesses the
# hard way) and close that gracefully.
# If that isn't successful within time let mixed
# do a cleanup although that will most likely lead to suicide.
KillMode=mixed
EnvironmentFile=-@CONFIGDIR@/sbd
ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
ExecStop=@bindir@/kill -TERM $MAINPID
ExecStart=@sbindir@/sbd $SBD_OPTS watch

# Could this benefit from exit codes for restart?
# Does this need to be set to msgwait * 1.2?
Expand Down
13 changes: 9 additions & 4 deletions src/sbd_remote.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ RefuseManualStop=true
RefuseManualStart=true

[Service]
Type=forking
PIDFile=@runstatedir@/sbd.pid
Type=simple
# sbd-inquisitor will usually have opened a watchdog-device
# thus we should give it a chance to do what
# it needs to (anyway kills the subprocesses the
# hard way) and close that gracefully.
# If that isn't successful within time let mixed
# do a cleanup although that will most likely lead to suicide.
KillMode=mixed
EnvironmentFile=-@CONFIGDIR@/sbd
ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
ExecStop=@bindir@/kill -TERM $MAINPID
ExecStart=@sbindir@/sbd $SBD_OPTS watch

# Could this benefit from exit codes for restart?
# Does this need to be set to msgwait * 1.2?
Expand Down

0 comments on commit 940ced8

Please sign in to comment.