ABHIONLINUX
Site useful for linux administration and web hosting

2010/01/20

Unable to start apache " pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run? semget: No space left on device"

If you are unable to start apache and you are getting the error log as
[Sat Oct 10 00:11:01 2008] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run?
semget: No space left on device
 
It means There is no more space left in Semaphore Arrays for Apache.
semaphore is a location in memory whose value can be tested and set by more than one process.
you can check the semaphore arrays on your server using the following command

ipcs -s

It results

------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 360448 nobody 600 1
0x00000000 393217 nobody 600 1
0x00000000 425986 nobody 600 1
0x00000000 458755 nobody 600 1
0x00000000 524292 nobody 600 1
0x00000000 1114117 nobody 600 1
0x00000000 1441798 nobody 600 1
0x00000000 3604487 nobody 600 1
0x00000000 3702792 nobody 600 1
0x00000000 3768329 nobody 600 1
0x00000000 6422538 nobody 600 1
0x00000000 7077899 nobody 600 1

If here you get big list of semaphores it means some semaphores are stuck. You can clear them out with this command:

for i in `ipcs -s | awk '/nobody/ {print $2}'`; do (ipcrm -s $i); done

 Restart apache
#/etc/init.d/httpd restart

2010/01/05

VPS : tty device is not owned by group `tty’

If you’re unable to SSH into a VPS server, try accessing the VPS from the OpenVZ hardware node.

[root@VS ~]# vzctl enter VID
entered into VE 1022
mesg: error: tty device is not owned by group `tty’

Here you can see that there is an error related to tty. This error can be resolved by changing the group of the tty files.

vzctl exec VIS'chgrp tty /dev/ttyp* /dev/ptyp*'

There can be many other reasons related to SSH failures.

You might like check on udev package also (You will normally find this issue on CentOS5)

Find the udev rpm on the VPS server,

root@vps1 [/]# rpm -qa | grep udev
udev-095-14.16.el5

Remove it from the server
root@vps1 [/]# rpm -e –nodeps udev

Once this is done, your SSH should start working fine.