Software - (solved) New /run and problem with apache2?

dario - 17.05.2011, 10:43
Post subject: (solved) New /run and problem with apache2?
I'm not sure this is due to the last upgrade and /run, but i have a strange problem with apache2: apache2 seems unable to execute cgi scripts because cgid doesn't start:

[Tue May 17 12:02:37 2011] [error] (2)No such file or directory: Couldn't bind unix domain socket /var/run/apache2/cgisock.2956
[Tue May 17 12:02:37 2011] [notice] Apache/2.2.17 (Debian) mod_perl/2.0.5 Perl/v5.12.3 configured -- resuming normal operations
[Tue May 17 12:02:37 2011] [crit] cgid daemon failed to initialize

Searching, i found these topics where a similar problem was related to the lack of the /var/run/apache2 directory:


In my system now /var/run points to /run, where there isn't any apache2 directory, could this be the same problem? If yes, is it safe to create the apache2 folder inside /run as suggested in the first link?
bfree - 17.05.2011, 11:17
Post subject: RE: New /run and problem with apache2?
It should be safe just to create it, but that will be lost when you reboot so it's not a long term fix. I just installed apache2 here on a clean system and it created /run/apache2:
root@augustus:~# ls -ld /run/apache2*
drwxr-xr-x 2 root root 60 May 17 12:11 /run/apache2
-rw-r--r-- 1 root root  5 May 17 12:11 /run/apache2.pid

Did you mess with your initscripts at all on your system?

I'm guessing this thread will move to the Software forum as I suspect it is not a common upgrade problem with apache2 (I think I know of some systems which will have d-u'd to /run versions fine without this problem), but I won't move it myself anyway until that is confirmed.
slh - 17.05.2011, 11:31
Post subject: RE: New /run and problem with apache2?
aptosid.com has been using /run/ with according sysvinit/ initramfs-tools for about a month, therefore this certainly isn't a general issue. That said, dæmon initscripts have always been required to create /var/run/<d>/ subdirectories while starting, as RAMRUN has been a valid configuration option for years, so any failure resulting from this would have been a RC bug already.
dario - 17.05.2011, 11:55
Post subject: RE: New /run and problem with apache2?
The only changes to default configuration was to disable apache and ssh on startup with boot-up-manager (i need it only sometimes to test web sites so i start it with apachectl).
bfree - 17.05.2011, 13:34
Post subject: RE: New /run and problem with apache2?
Peronsally I disable it from starting with
update-rc.d apache2 disable

and then just use it's initscript instead to start|stop it when I want:

service apache2 start

/etc/init.d/apache2 start

Are you just calling apachectl without any arguments or with arguments but not start as the first one?
apachectl start

should have made /var/run/apache2 but I think none of the other ways of calling apachectl will do it (apart from adding options after start).
dario - 17.05.2011, 14:35
Post subject:
I used to start it using:


apachectl graceful

now i tried apachectl start and it works, i'm very sorry (need an auto-facepalm smiley) for the stupid question, i didn't try this but only "apachectl restart", i was convinced that the result of "restart" was the same as calling "stop" and after "start".
However, thank you very much!
All times are GMT - 12 Hours
Powered by PNphpBB2 © 2003-2010 The Zafenio Group