web analytics

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Noticed this error in a cpanel server while starting apache. Apache refused to start with the following error.

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Seeing the error, the first thing that I checked was the disk space in the server but it looked fine.

root@abc [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg0-root   16G  1.2G   14G   8% /
/dev/mapper/vg0-home  249G  124G  113G  53% /home
/dev/mapper/vg0-var    23G  7.0G   15G  33% /var
/dev/mapper/vg0-usr    23G  7.6G   14G  36% /usr
/dev/mapper/vg0-tmp   9.5G  151M  8.9G   2% /tmp
/dev/sda1             7.4G  184M  6.9G   3% /boot
tmpfs                 7.9G     0  7.9G   0% /dev/shm
/dev/mapper/vg1-backup
296G  221G   75G  75% /backup

Next, I checked the inode usage, that also looked fine.

root@abc [~]# df -hi
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/mapper/vg0-root    4.0M     16K    4.0M    1% /
/dev/mapper/vg0-home     65M    784K     64M    2% /home
/dev/mapper/vg0-var     5.9M     28K    5.9M    1% /var
/dev/mapper/vg0-usr     5.9M    155K    5.8M    3% /usr
/dev/mapper/vg0-tmp     2.5M     155    2.5M    1% /tmp
/dev/sda1               2.0M      65    2.0M    1% /boot
tmpfs                   2.0M       1    2.0M    1% /dev/shm
/dev/mapper/vg1-backup
38M    1.9M     36M    6% /backup

 

Guessed, the problem could be with semaphores. You can check it as follows.

root@abc [~]# ipcs -s | grep nobody
0x00000000 255000576  nobody    600        1
0x00000000 255033345  nobody    600        1
0x00000000 255066114  nobody    600        1
0x00000000 255098883  nobody    600        1
0x00000000 264339460  nobody    600        1
0x00000000 264372229  nobody    600        1
0x00000000 264404998  nobody    600        1
0x00000000 264437767  nobody    600        1
0x00000000 264634376  nobody    600        1
0x00000000 264667145  nobody    600        1
0x00000000 264699914  nobody    600        1
0x00000000 264732683  nobody    600        1
0x00000000 278429708  nobody    600        1
0x00000000 278462477  nobody    600        1
0x00000000 278495246  nobody    600        1
0x00000000 278528015  nobody    600        1
0x00000000 279773200  nobody    600        1
0x00000000 279805969  nobody    600        1
0x00000000 279838738  nobody    600        1

This was causing the problem. We need to remove semaphores and restart apache. You can use the following command to remove semaphores.

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

Check again now. All semaphores would be gone. Restart apache and it will work

root@abc [~]# ipcs -s | grep nobody

root@abc [~]# /etc/rc.d/init.d/httpd restart

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>