gdraheim / docker-systemctl-replacement

docker systemctl replacement - allows to deploy to systemd-controlled containers without starting an actual systemd daemon (e.g. centos7, ubuntu16)
European Union Public License 1.2
1.4k stars 401 forks source link

Systemd notification does not wait when `0` is specified #135

Open mvorisek opened 2 years ago

mvorisek commented 2 years ago

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.

gdraheim commented 2 years ago

Yes, that should be in the next version.

gdraheim commented 2 years ago

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.