Created attachment 358770 [details] emerge info of systemd With systemd-206-r5, php-fpm@5.5 can be stop normally: # systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: active (running) since 一 2013-09-16 14:29:20 CST; 57s ago Main PID: 253 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/system-php\x2dfpm.slice/php-fpm@5.5.service ├─253 php-fpm: master process (/etc/php/fpm-php5.5/php-fpm.conf) ├─300 php-fpm: pool www ├─301 php-fpm: pool www ├─302 php-fpm: pool www ├─303 php-fpm: pool www └─304 php-fpm: pool www 9月 16 14:29:20 timemars systemd[1]: Starting The PHP FastCGI Process Manager... 9月 16 14:29:20 timemars systemd[1]: Started The PHP FastCGI Process Manager. and after I execute the command "systemctl stop php-fpm@5.5", php-fpm@5.5 stops: # systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: inactive (dead) since 一 2013-09-16 14:30:23 CST; 6s ago Process: 253 ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize (code=exited, status=0/SUCCESS) Main PID: 253 (code=exited, status=0/SUCCESS) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" 9月 16 14:29:20 timemars systemd[1]: Starting The PHP FastCGI Process Manager... 9月 16 14:29:20 timemars systemd[1]: Started The PHP FastCGI Process Manager. 9月 16 14:30:23 timemars systemd[1]: Stopping The PHP FastCGI Process Manager... 9月 16 14:30:23 timemars systemd[1]: Stopped The PHP FastCGI Process Manager. However, I upgraded systemd to 207 some days, and found that something had changed: At first: $ systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: active (running) since 一 2013-09-16 14:51:11 CST; 36s ago Main PID: 259 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/system-php\x2dfpm.slice/php-fpm@5.5.service ├─259 php-fpm: master process (/etc/php/fpm-php5.5/php-fpm.conf) ├─313 php-fpm: pool www ├─314 php-fpm: pool www ├─315 php-fpm: pool www ├─316 php-fpm: pool www └─317 php-fpm: pool www then I try to stop it using "systemctl stop php-fpm@5.5", and it hangs there: $ systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: deactivating (stop-sigterm) since 一 2013-09-16 14:51:59 CST; 2s ago Main PID: 259 Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/system-php\x2dfpm.slice/php-fpm@5.5.service 1 min 30s later: $ systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: deactivating (stop-sigkill) (Result: timeout) since 一 2013-09-16 14:51:59 CST; 1min 30s ago Main PID: 259 Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/system-php\x2dfpm.slice/php-fpm@5.5.service and finally 3 mins later: $ systemctl status php-fpm@5.5 php-fpm@5.5.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib64/systemd/system/php-fpm@.service; enabled) Active: failed (Result: timeout) since 一 2013-09-16 14:54:59 CST; 1s ago Main PID: 259 Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" Usually I seldom stop/restart php-fpm, so it is ok. but i stuck 3 min at shutdown/reboot, that's annoying.
Created attachment 358776 [details] emerge info of php
I would report to upstream (as we are using the official unit files from php upstream)
Created attachment 359212 [details] shutdown-log Since normal reboot or poweroff work, but take a suspiciously long time, I follow the instruction decribed at http://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1, and get the shutdown-log.
It seem that it's a systemd bug regarding Type=notify services. Here is the bug upstream: http://lists.freedesktop.org/archives/systemd-devel/2013-September/013334.html Apply that patch solved the issue for me. That kind of bug can drive people nuts :) - http://forums.gentoo.org/viewtopic-t-970180.html
We will backport the patch once one gets into systemd git.
(In reply to Cănărău Constantin from comment #4) > It seem that it's a systemd bug regarding Type=notify services. Here is the > bug upstream: > http://lists.freedesktop.org/archives/systemd-devel/2013-September/013334. > html > Apply that patch solved the issue for me. > That kind of bug can drive people nuts :) - > http://forums.gentoo.org/viewtopic-t-970180.html this patch works, thanks. But there's still a problem. The patch is said to fix timeout when stopping Type=notify service, yet I notice that rsyslog.service is also a Type=notify service, and it doesn't stuck the reboot/poweroff process. It seems that only some Type=notify services cause timeout when being stopped.
(In reply to timemars from comment #6) > this patch works, thanks. But there's still a problem. The patch is said to > fix timeout when stopping Type=notify service, yet I notice that > rsyslog.service is also a Type=notify service, and it doesn't stuck the > reboot/poweroff process. It seems that only some Type=notify services cause > timeout when being stopped. Yes, you are right. I didnt' notice that. But, in the end, I'm happy - everything it's working like a charm again.
Thanks a lot for finding the solution :)
Temporary workaround that does not require patching systemd: Edit /usr/lib/systemd/system/php-fpm@.service and add "TimeoutStopSec=2" to its "[Service]" section. According to http://www.freedesktop.org/software/systemd/man/systemd.service.html the default is 90 seconds.
208 is in the tree now