docker-systemctl-replacement icon indicating copy to clipboard operation
docker-systemctl-replacement copied to clipboard

Systemd notification does not wait when `0` is specified

Open mvorisek opened this issue 4 years ago • 2 comments

Some services like mysql server use 0 for timeout which should imply, based on the official https://github.com/systemd/systemd/pull/10501, infinity wait

Example config:

[Unit]
Description=MySQL Community Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
Type=notify
PermissionsStartOnly=true
ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre
ExecStart=/usr/sbin/mysqld
TimeoutSec=0
LimitNOFILE = 10000
Restart=on-failure
RestartPreventExitStatus=1

The docker-systemctl-replacement must wait at least DefaultMaximumTimeout (as defined in systemctl3.py) when 0, 0s or infinity is specified.

mvorisek avatar Dec 08 '21 09:12 mvorisek

Yes, that should be in the next version.

gdraheim avatar Dec 08 '21 09:12 gdraheim

Looking for "infinity" it seems that using "0" is an undocumented feature of systemd.

https://www.freedesktop.org/software/systemd/man/systemd.service.html

Such things are quite usual in the systemd world, so I'll put that also on the list of checks that the systemctl-replacement script will show a warning for.

gdraheim avatar Dec 09 '21 09:12 gdraheim