Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] apache2 not running (no pid file)
Date: Fri, 16 Dec 2011 20:32:07
Message-Id: CAN0CFw0v=K+mOYr9tUchj+sej_xnvbv+SHMHSATX8-B2G2mUFg@mail.gmail.com
In Reply to: Re: [gentoo-user] apache2 not running (no pid file) by Mick
1 >> > Has anyone else noticed this sort of behavior from apache-2.2.21-r1:
2 >> >
3 >> > # /etc/init.d/apache2 restart
4 >> >
5 >> >  * Stopping apache2 ... [ ok ]
6 >> >  * Starting apache2 ...
7 >> >  * start-stop-daemon: /usr/sbin/apache2 is already running [ ok ]
8 >> >
9 >> > # /etc/init.d/apache2 restart
10 >> >
11 >> >  * apache2 not running (no pid file)
12 >> >  * Starting apache2 ... [ ok ]
13 >> >
14 >> > It probably happens about half the time I restart apache2.  Nothing in
15 >> > /var/log/apache2/error_log besides:
16 >> >
17 >> > [notice] caught SIGTERM, shutting down
18 >> > [notice] Apache/2.2.21 (Unix) configured -- resuming normal operations
19 >> >
20 >> > - Grant
21 >>
22 >> I've seen that for years.  I always assumed it was because the apache2
23 >> stop didn't complete before the apache2 start tried to start when I use
24 >> /etc/init.d/apache2 restart.
25 >>
26 >> Instead I do an /etc/init.d/apache2 stop; ps aux | egrep apache until I
27 >> see all the threads are gone and then a /etc/init.d/apache2 start
28 >
29 > +1
30 >
31 > If there aren't many threads a quick restart will work fine, but if there are
32 > many threads hanging around then you may be better off to stop, wait, then
33 > start.
34
35 Thanks fellas, that makes perfect sense. Would it make sense for me
36 to request a change to the initscript that waits until all threads
37 have stopped before starting during a restart?
38
39 - Grant

Replies

Subject Author
Re: [gentoo-user] apache2 not running (no pid file) Michael Orlitzky <michael@××××××××.com>