looks like sometimes systemd tries to create the runtime-directory for ExecStart *and* ExecStartPost while the second attempt fails because the directory already exists it don't happen that often since i see it only once or a few times per day while on several machines there are two mysqld instances which are stopped and started (both different RuntimeDirectory) for rsync the datadir every hour luckily "Restart=always" is fixing this but failing the service and so killing the already clean started mysqld at the first attempt is not that good ____________________________________________________________ May 30 06:19:26 backup-arrakis systemd: Failed at step RUNTIME_DIRECTORY spawning /usr/libexec/mysqld-wait-ready: File exists May 30 06:19:26 backup-arrakis systemd: Failed to start MariaDB Database. May 30 06:19:26 backup-arrakis systemd: Unit mysqld.service entered failed state. May 30 06:19:26 backup-arrakis systemd: mysqld.service failed ____________________________________________________________ [Unit] Description=MariaDB Database Before=postfix.service dovecot.service dbmail-imapd.service dbmail-lmtpd.service dbmail-pop3d.service dbmail-timsieved.service [Service] Type=simple User=mysql Group=mysql RuntimeDirectory=mysqld RuntimeDirectoryMode=0750 ExecStart=/usr/libexec/mysqld --defaults-file=/etc/my.cnf --pid-file=/run/mysqld/mysqld.pid ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID Environment="LANG=en_GB.UTF-8" Restart=always RestartSec=1 TimeoutSec=300 LimitNOFILE=infinity LimitMEMLOCK=infinity OOMScoreAdjust=-1000 PrivateTmp=yes PrivateDevices=yes NoNewPrivileges=yes CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_DAC_OVERRIDE CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE CAP_SYS_PTRACE RestrictAddressFamilies=~AF_APPLETALK AF_ATMPVC AF_AX25 AF_IPX AF_NETLINK AF_PACKET AF_X25 SystemCallArchitectures=x86-64 ReadOnlyDirectories=/etc ReadOnlyDirectories=/usr ReadOnlyDirectories=/var/lib ReadWriteDirectories=/var/lib/mysql InaccessibleDirectories=-/boot InaccessibleDirectories=-/home InaccessibleDirectories=-/root InaccessibleDirectories=-/media InaccessibleDirectories=-/usr/local/scripts InaccessibleDirectories=-/var/lib/dbus InaccessibleDirectories=-/var/lib/dnf InaccessibleDirectories=-/var/lib/rpm InaccessibleDirectories=-/var/lib/systemd InaccessibleDirectories=-/var/lib/yum InaccessibleDirectories=-/var/spool InaccessibleDirectories=-/run/dbus InaccessibleDirectories=-/run/lock InaccessibleDirectories=-/run/mount InaccessibleDirectories=-/run/systemd/generator InaccessibleDirectories=-/run/systemd/system InaccessibleDirectories=-/run/systemd/users InaccessibleDirectories=-/run/udev InaccessibleDirectories=-/run/user [Install] WantedBy=multi-user.target ____________________________________________________________ [Unit] Description=MariaDB Replication [Service] Type=simple User=mysql Group=mysql RuntimeDirectory=mysqld-replication RuntimeDirectoryMode=0750 ExecStart=/usr/libexec/mysqld --defaults-file=/etc/my-replication.cnf --pid-file=/run/mysqld-replication/mysqld.pid Environment="LANG=en_GB.UTF-8" Restart=always RestartSec=1 TimeoutSec=300 LimitNOFILE=infinity LimitMEMLOCK=infinity OOMScoreAdjust=-1000 PrivateTmp=yes PrivateDevices=yes NoNewPrivileges=yes CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_DAC_OVERRIDE CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE CAP_SYS_PTRACE RestrictAddressFamilies=~AF_APPLETALK AF_ATMPVC AF_AX25 AF_IPX AF_NETLINK AF_PACKET AF_X25 SystemCallArchitectures=x86-64 ReadOnlyDirectories=/etc ReadOnlyDirectories=/usr ReadOnlyDirectories=/proc ReadOnlyDirectories=/sys ReadOnlyDirectories=/var/lib ReadWriteDirectories=/var/lib/mysql InaccessibleDirectories=/boot InaccessibleDirectories=/home InaccessibleDirectories=/root InaccessibleDirectories=/media InaccessibleDirectories=/usr/local/scripts InaccessibleDirectories=/var/lib/dbus InaccessibleDirectories=/var/lib/rpm InaccessibleDirectories=/var/lib/systemd InaccessibleDirectories=/var/lib/yum InaccessibleDirectories=/var/spool InaccessibleDirectories=/run/dbus InaccessibleDirectories=/run/lock InaccessibleDirectories=/run/mount InaccessibleDirectories=/run/systemd/generator InaccessibleDirectories=/run/systemd/system InaccessibleDirectories=/run/systemd/users InaccessibleDirectories=/run/udev InaccessibleDirectories=/run/user [Install] WantedBy=multi-user.target
and maybe the runtime directory is not always removed cleanly at stop so that the following start leads to fail in this case which means there are possibly *two* bugs in that context
WTF - Just be happy when that directory exists and you are dont insetad fail pretty fine services - systemd should *really* start with QA instead feature bloat Jul 5 00:18:10 backup-arrakis systemd: Failed at step RUNTIME_DIRECTORY spawning /usr/libexec/mysqld-wait-ready: File exists Jul 5 00:18:10 backup-arrakis systemd: mysqld.service: control process exited, code=exited status=233 Jul 5 00:18:10 backup-arrakis systemd: Failed to start MariaDB Database. Jul 5 00:18:10 backup-arrakis systemd: Unit mysqld.service entered failed state.
reproducer: after 99 times "systemctl start test2; systemctl stop test2; cat /var/log/messages" it happens with the noop-unit below Jul 7 11:05:19 rh systemd: Failed at step RUNTIME_DIRECTORY spawning /usr/bin/true: File exists Jul 7 11:05:19 rh systemd: test2.service: control process exited, code=exited status=233 Jul 7 11:05:19 rh systemd: Failed to start Test Unit. Jul 7 11:05:19 rh systemd: Unit test2.service entered failed state. ___________________________________________________________ [root@rh:~]$ cat /etc/systemd/system/test2.service [Unit] Description=Test Unit [Service] Type=simple User=nobody Group=nobody RuntimeDirectory=test2 RuntimeDirectoryMode=0750 ExecStart=/usr/local/bin/loop.sh ExecStartPost=/usr/bin/true Environment="LANG=en_GB.UTF-8" Restart=always RestartSec=1 TimeoutSec=300 LimitNOFILE=infinity LimitMEMLOCK=infinity OOMScoreAdjust=-1000 PrivateTmp=yes PrivateDevices=yes NoNewPrivileges=yes CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_WRITE CAP_DAC_OVERRIDE CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE CAP_SYS_PTRACE RestrictAddressFamilies=~AF_APPLETALK AF_ATMPVC AF_AX25 AF_IPX AF_NETLINK AF_PACKET AF_X25 ReadOnlyDirectories=/etc ReadOnlyDirectories=/usr [Install] WantedBy=multi-user.target ___________________________________________________________ [root@rh:~]$ cat /usr/local/bin/loop.sh #!/usr/bin/bash while : do sleep 1 done
the same on F22 with systemd-219-19.fc22.x86_64 [root@rawhide ~]# systemctl stop test2; systemctl start test2; sleep 1; cat messages Job for test2.service failed. See "systemctl status test2.service" and "journalctl -xe" for details. Jul 15 16:19:19 rawhide systemd: Stopping Test Unit... Jul 15 16:19:19 rawhide systemd: Stopped Test Unit. Jul 15 16:19:19 rawhide systemd: Starting Test Unit... Jul 15 16:19:19 rawhide systemd: Started Test Unit. Jul 15 16:19:21 rawhide systemd: Stopping Test Unit... Jul 15 16:19:21 rawhide systemd: Stopped Test Unit. Jul 15 16:19:21 rawhide systemd: Starting Test Unit... Jul 15 16:19:21 rawhide systemd: Started Test Unit. Jul 15 16:19:23 rawhide systemd: Stopping Test Unit... Jul 15 16:19:23 rawhide systemd: Stopped Test Unit. Jul 15 16:19:23 rawhide systemd: Starting Test Unit... Jul 15 16:19:23 rawhide systemd: Started Test Unit. Jul 15 16:19:25 rawhide systemd: Stopping Test Unit... Jul 15 16:19:25 rawhide systemd: Stopped Test Unit. Jul 15 16:19:25 rawhide systemd: Starting Test Unit... Jul 15 16:19:25 rawhide systemd: Started Test Unit. Jul 15 16:19:27 rawhide systemd: Stopping Test Unit... Jul 15 16:19:27 rawhide systemd: Stopped Test Unit. Jul 15 16:19:27 rawhide systemd: Starting Test Unit... Jul 15 16:19:27 rawhide systemd: Started Test Unit. Jul 15 16:19:28 rawhide systemd: Stopping Test Unit... Jul 15 16:19:28 rawhide systemd: Stopped Test Unit. Jul 15 16:19:28 rawhide systemd: Starting Test Unit... Jul 15 16:19:28 rawhide systemd: Started Test Unit. Jul 15 16:19:30 rawhide systemd: Stopping Test Unit... Jul 15 16:19:30 rawhide systemd: Stopped Test Unit. Jul 15 16:19:30 rawhide systemd: Starting Test Unit... Jul 15 16:19:30 rawhide systemd: Started Test Unit. Jul 15 16:19:32 rawhide systemd: Stopping Test Unit... Jul 15 16:19:32 rawhide systemd: Stopped Test Unit. Jul 15 16:19:32 rawhide systemd: Starting Test Unit... Jul 15 16:19:32 rawhide systemd: Started Test Unit. Jul 15 16:19:34 rawhide systemd: Stopping Test Unit... Jul 15 16:19:34 rawhide systemd: Stopped Test Unit. Jul 15 16:19:34 rawhide systemd: Starting Test Unit... Jul 15 16:19:34 rawhide systemd: Started Test Unit. Jul 15 16:19:36 rawhide systemd: Stopping Test Unit... Jul 15 16:19:36 rawhide systemd: Stopped Test Unit. Jul 15 16:19:36 rawhide systemd: Starting Test Unit... Jul 15 16:19:36 rawhide systemd: Started Test Unit. Jul 15 16:19:38 rawhide systemd: Stopping Test Unit... Jul 15 16:19:38 rawhide systemd: Stopped Test Unit. Jul 15 16:19:38 rawhide systemd: Starting Test Unit... Jul 15 16:19:38 rawhide systemd: Started Test Unit. Jul 15 16:19:39 rawhide systemd: Stopping Test Unit... Jul 15 16:19:39 rawhide systemd: Stopped Test Unit. Jul 15 16:19:39 rawhide systemd: Starting Test Unit... Jul 15 16:19:39 rawhide systemd: Started Test Unit. Jul 15 16:19:41 rawhide systemd: Stopping Test Unit... Jul 15 16:19:41 rawhide systemd: Stopped Test Unit. Jul 15 16:19:41 rawhide systemd: Starting Test Unit... Jul 15 16:19:41 rawhide systemd: Started Test Unit. Jul 15 16:19:43 rawhide systemd: Stopping Test Unit... Jul 15 16:19:43 rawhide systemd: Stopped Test Unit. Jul 15 16:19:43 rawhide systemd: Starting Test Unit... Jul 15 16:19:43 rawhide systemd: Failed at step RUNTIME_DIRECTORY spawning /usr/bin/true: File exists Jul 15 16:19:43 rawhide systemd: test2.service: control process exited, code=exited status=233 Jul 15 16:19:43 rawhide systemd: Failed to start Test Unit. Jul 15 16:19:43 rawhide systemd: Unit test2.service entered failed state. Jul 15 16:19:43 rawhide systemd: test2.service failed.
Should be fixed by: https://github.com/systemd/systemd/pull/896
what about fixing Fedora bugs? that bug was reported 3 months ago and there exists a fix upstream while the Fedora maintainer did not find it woth to even make a single comment https://bugzilla.redhat.com/show_bug.cgi?id=1184016 was also open 3 months which means finally that systemd in F21 was broken for half of the release life time
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.