Description of problem: Due a bug, the pdns daemon returns exit code 1 when stopping the pdns service. To work around this problem you set a dash after ExecStart in the systemd unit file. Version-Release number of selected component (if applicable): systemd-192-1.fc18.x86_64 systemd-44-17.fc17.x86_64 How reproducible: 1. install a daemon (like pdns 3.1-2 or lower) which returns exit code 1 when stopping the service 2. configure a pdns backend like mysql 3. edit the systemd unit file: For example: ExecStart=-/usr/sbin/pdns_server --daemon --guardian=yes instead of ExecStart=/usr/sbin/pdns_server --daemon --guardian=yes 4. start and stop the daemon Actual results: systemd does not recognize the dash after ExecStart. Expected results: systemd should report no error Additional info: FC18: [root@fc18 ~]# rpm -q systemd systemd-192-1.fc18.x86_64 [root@fc18 pdns]# cat /etc/systemd/system/multi-user.target.wants/pdns.service [Unit] Description=PDNS DNS Server After=network.target [Service] Type=forking ExecStart=-/usr/sbin/pdns_server --daemon --guardian=yes ExecReload=/usr/bin/pdns_control cycle ExecStop=/usr/bin/pdns_control quit [Install] WantedBy=multi-user.target [root@fc18 pdns]# systemctl --system daemon-reload [root@fc18 pdns]# systemctl start pdns.service [root@fc18 pdns]# systemctl stop pdns.service [root@fc18 pdns]# systemctl status pdns.service pdns.service - PDNS DNS Server Loaded: loaded (/usr/lib/systemd/system/pdns.service; enabled) Active: failed (Result: exit-code) since Tue, 25 Sep 2012 23:24:56 +0200; 4s ago Process: 1087 ExecStop=/usr/bin/pdns_control quit (code=exited, status=0/SUCCESS) Process: 1040 ExecStart=/usr/sbin/pdns_server --daemon --guardian=yes (code=exited, status=0/SUCCESS) Main PID: 1041 (code=exited, status=1/FAILURE) CGroup: name=systemd:/system/pdns.service [root@fc18 pdns]# cat /var/log/messages Sep 25 23:24:56 fc18 systemd[1]: Stopping PDNS DNS Server... Sep 25 23:24:56 fc18 pdns[1041]: Scheduling exit on remote request Sep 25 23:24:56 fc18 pdns_control[1087]: Scheduling exit Sep 25 23:24:56 fc18 pdns[1041]: Guardian is killed, taking down children with us Sep 25 23:24:56 fc18 systemd[1]: pdns.service: main process exited, code=exited, status=1 Sep 25 23:24:56 fc18 systemd[1]: Stopped PDNS DNS Server. Sep 25 23:24:56 fc18 systemd[1]: Unit pdns.service entered failed state. FC17: [root@fc17 ~]# rpm -q systemd systemd-44-17.fc17.x86_64 [root@fc17 pdns]# cat /etc/systemd/system/multi-user.target.wants/pdns.service [Unit] Description=PDNS DNS Server After=network.target [Service] Type=forking ExecStart=-/usr/sbin/pdns_server --daemon --guardian=yes ExecReload=/usr/bin/pdns_control cycle ExecStop=/usr/bin/pdns_control quit [Install] WantedBy=multi-user.target [root@fc17 pdns]# systemctl --system daemon-reload [root@fc17 pdns]# systemctl start pdns.service [root@fc17 pdns]# systemctl stop pdns.service [root@fc17 pdns]# systemctl status pdns.service pdns.service - PDNS DNS Server Loaded: loaded (/usr/lib/systemd/system/pdns.service; enabled) Active: failed (Result: exit-code) since Tue, 25 Sep 2012 23:30:24 +0200; 3s ago Process: 18382 ExecStop=/usr/bin/pdns_control quit (code=exited, status=0/SUCCESS) Process: 18335 ExecStart=/usr/sbin/pdns_server --daemon --guardian=yes (code=exited, status=0/SUCCESS) Main PID: 18336 (code=exited, status=1/FAILURE) CGroup: name=systemd:/system/pdns.service [root@fc17 pdns]# cat /var/log/messages Sep 25 23:30:24 fc17 pdns[18336]: Scheduling exit on remote request Sep 25 23:30:24 fc17 pdns_control[18382]: Scheduling exit Sep 25 23:30:24 fc17 pdns[18336]: Guardian is killed, taking down children with us Sep 25 23:30:24 fc17 systemd[1]: pdns.service: main process exited, code=exited, status=1 Sep 25 23:30:24 fc17 systemd[1]: Unit pdns.service entered failed state.
Well, so what happens here is that systemd applies the dash only to the process systemd actualyl spawned, but not the the main process of the service. You use Type=forking, hence the destinction: systemd will ignore the return value of the starter process, but not of the forkedd of bg process. Not sure what we should about this. The simplest solution might be to simply copy the ignore flag from the starter process' setting to the main service process' setting. That would then make it work the way you expect.
Fixed int git: http://cgit.freedesktop.org/systemd/systemd/commit/?id=fbeefb45ac1a257a0c5af975ad26d68ed6c39fda
systemd-197-1.fc18.2 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/systemd-197-1.fc18.2
Package systemd-197-1.fc18.2: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing systemd-197-1.fc18.2' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-1590/systemd-197-1.fc18.2 then log in and leave karma (feedback).
Package initscripts-9.42.2-1.fc18, systemd-197-1.fc18.2: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing initscripts-9.42.2-1.fc18 systemd-197-1.fc18.2' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-1590/initscripts-9.42.2-1.fc18,systemd-197-1.fc18.2 then log in and leave karma (feedback).
initscripts-9.42.2-1.fc18, systemd-197-1.fc18.2 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.