Debian 12.9
Restarts of the SOGo process after nightly upgrades were taking about 20
seconds, with almost all of that coming from the stop command.
On Debian, this is because the systemd script in /etc/init.d/sogo uses the
SIGTERM signal to try stopping the program, but systemd does not know how to do
that with a SIGTERM signal. Instead the script waits for the 20-second timeout
before just sending a SIGKILL symbol:
start-stop-daemon -c $USER --stop --pidfile $PIDFILE --retry=TERM/20/KILL/5
--oknodo
rm -f $PIDFILE
As I learned with different program running on Debian, SIGTERM and SIGINT
*should* be equivalent with systemd but they’re not. Only a SIGINT signal will
stop the process.
On my system, I edited lines 80 and 87 of the /etc/init.d/sogo script to read
like this:
start-stop-daemon -c $USER --stop --pidfile $PIDFILE --retry=INT/20/KILL/5
--oknodo
rm -f $PIDFILE
After running ‘systemctl daemon-reload’, as with any change to startup/shutdown
scripts, the system now stops (and restarts) SOGo almost instantaneously.
dn