Another few hours of my all-too-short youth irretrievably lost
[Warning. Hardcore nerd post.]
In the process of writing a web application with mod_python, I had to restart my web server. A lot. Apparently, Apache 2 (the web server in question) doesn’t like this, and starts dying on boot with error messages along the lines of
[Mon Dec 12 02:23:17 2005] [emerg] (28)No space left on device: Couldn't create accept lock
…although the disk had plenty of free space and no shortage of inodes.
I Googled this quite a bit. A number of sites suggested looking for zombie semaphores with ipcs and deleting them with ipcrm. But when I ran ipcs, all I got was
$ ipcs ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status ------ Semaphore Arrays -------- key semid owner perms nsems ------ Message Queues -------- key msqid owner perms used-bytes messages
It took me way too long to realize that ipcs was showing me the semaphores that I (user=jdb) owned, not the ones that the web server (user=www-data) owned. [Slaps forehead.]
Oh well. Live and learn.
So, to actually trash all of the unneeded semaphores (why is there a limit on these, anyway?), become root, stop apache, and type something along the lines of:
for i in `ipcs -s|grep www-data|tr ' ' '\t' |cut -f 2`; do ipcrm -s $i; done
