Skip to content

Commit 940ced8

Browse files
committed
Fix: systemd: switch from legacy forking to simple service
1 parent 3ba9640 commit 940ced8

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/sbd.service.in

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ RefuseManualStop=true
99
RefuseManualStart=true
1010

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

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

src/sbd_remote.service.in

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ RefuseManualStop=true
77
RefuseManualStart=true
88

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

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

0 commit comments

Comments
 (0)