Description of problem: memcached starts, but cannot write its PID file and then is killed by systemd Version-Release number of selected component (if applicable): memcached-1.4.13-2.fc18 How reproducible: 100% Steps to Reproduce: 1. systemctl enable memcached 2. systemctl start memcached (this takes a while, be patient) 3. verify failure Actual results: memcached is not available after reboot Expected results: memcached works Additional info: This happens because, on the one hand, the directory for PID files is created one level down: [root@kvm-rei zaitcev]# more /etc/tmpfiles.d/memcached.conf D /var/run/memcached/memcached 0710 memcached memcached - [root@kvm-rei zaitcev]# ls -la /var/run/memcached/ total 0 drwxr-xr-x. 3 root root 60 Nov 19 14:06 . drwxr-xr-x. 22 root root 760 Nov 19 14:06 .. drwx--x---. 2 memcached memcached 40 Nov 19 14:06 memcached [root@kvm-rei zaitcev]# But on the other hand, the unit file specifies the PID file in /var/run/memcached/, owned by root: [root@kvm-rei zaitcev]# more /usr/lib/systemd/system/memcached.service ................. [Service] Type=forking EnvironmentFile=-/etc/sysconfig/memcached PIDFile=/var/run/memcached/memcached.pid ExecStart=/usr/bin/memcached -d -u $USER -P /var/run/memcached/memcached.pid -p $PORT -m $CACHESIZE -c $MAXCONN $OPTIONS ................. [root@kvm-rei zaitcev]# Once started by systemd, memcached cannot create PID file. Then, systemd fails to find the PID file and terminates the control group. The real root cause of the problem is using the "forking" type in the unit file. The proper fix is to stop daemonizeing and use "simple" type. In that case PID file is not necessary.
Commit: http://pkgs.fedoraproject.org/gitweb/?p=memcached.git;a=commitdiff;h=41935efcc5a8979267050b41277f8a8e61de770d Package: memcached-1.4.15-1.fc19 Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=367840
*** Bug 878530 has been marked as a duplicate of this bug. ***
Verified fixed in memcached-1.4.15-1.fc19 (from Koji). Closing.
memcached-1.4.15-2.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/memcached-1.4.15-2.fc18
memcached-1.4.15-2.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.