On my workstation I use for test purposes web-server (www-servers/apache-2.2.21-r1), which starts automatically. The issue appears when I need to update its configuration: manual restart after auto-start of httpd daemon fails (after manual start it works fine). The issue: # /etc/init.d/apache2 restart * Caching service dependencies ... [ ok ] * Stopping apache2 ... [ ok ] * Starting apache2 ... * start-stop-daemon: /usr/sbin/apache2 is already running [ ok ] First time manual restart (daemon not started): # /etc/init.d/apache2 restart * apache2 not running (no pid file) * Starting apache2 ... [ ok ] Second time manual restart (the daemon was started manually): # /etc/init.d/apache2 restart * Stopping apache2 ... [ ok ] * Starting apache2 ... [ ok ]
How are you auto-restarting apache?
(In reply to comment #1) > How are you auto-restarting apache? Automatically it's done by openrc during startup and shutdown. Manually: 1. get root shell (su -). 2. And execute from it the command: /etc/init.d/apache2 restart After today's system update (yesterday's portage snapshot), sys-apps/busybox was updated, the issue seems to go away. But I need a time to check.
Why do you say it's failing then? All of your output in the initial bug comment has it starting fine. Manually is doing it outside of the init script.
(In reply to comment #3) > Why do you say it's failing then? > > All of your output in the initial bug comment has it starting fine. > > Manually is doing it outside of the init script. Today I've rechecked issue. The bug was reproduced. Initially (during boot process) apache is started by openrc: # rc-update show | grep apache apache2 | default When I need to update already autostarted apache configuration, I have to restart it manually: # /etc/init.d/apache2 restart * Stopping apache2 ... [ ok ] * Starting apache2 ... * start-stop-daemon: /usr/sbin/apache2 is already running [ ok ] (last string contains error message, after executing listed command the web-server is actually down) Next manual restart produces the following output: # /etc/init.d/apache2 restart * apache2 not running (no pid file) * Starting apache2 ... [ ok ] And all later _manual_ restarts of web server work as they should.
This is not a OpenRC bug, see also bug 383093. # /etc/init.d/apache2 restart * Stopping apache2 ... [ ok ] * Starting apache2 ... * start-stop-daemon: /usr/sbin/apache2 is already running # /etc/init.d/apache2 restart * apache2 not running (no pid file) * Starting apache2 ...
(In reply to comment #5) > This is not a OpenRC bug, see also bug 383093. > In my case it is test web-server for localhost-only on workstation (so it couldn't be heavy-loaded). Yesterday I've find another example, where _first_ restart of apache web-server fails: I use apache together with mod_php5. After _some_ changes in php.ini (mentioned turning on syslog logging facility) _first_ restart fails (second and following works OK).
bittern ~ # /etc/init.d/apache2 restart * Stopping apache2 ... [ ok ] * Starting apache2 ... * start-stop-daemon: /usr/sbin/apache2 is already running [ ok ] bittern ~ # /etc/init.d/apache2 stop * apache2 not running (no pid file) bittern ~ # ps aux|grep apache root 27213 0.0 0.0 8076 616 pts/0 S+ 20:16 0:00 grep --colour=auto apache bittern ~ # /etc/init.d/apache2 start * Starting apache2 ...
*** Bug 405243 has been marked as a duplicate of this bug. ***
I think that this bug can be related to Bug 389965.
(In reply to comment #9) > I think that this bug can be related to Bug 389965. confirmed, this change solved the issue : - while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \ + while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
*** This bug has been marked as a duplicate of bug 389965 ***