0

last night my apache server has crashed with error:

(28)No space left on device: AH00023: Couldn't create the ldap-cache mutex

after googling where error was I've discovered that was something linked with apache semaphore management. I've kill any apache pending semaphore and now it's ok:

 > ipcs -s
 > ipcrm <semid>

now... I see that on apache startup semaphores has been restored (apache is up and running) but some other semaphores had been created (I think) by some php process and with strange priviledges:

 > ipcs -s
key        semid      owner      perms      nsems
0x00000000 0          root       600        1
0x00000000 32769      root       600        1
0x00000000 97517570   nobody     600        1
0x00000000 97550339   nobody     600        1
0x00000000 97583108   nobody     600        1
0x00000000 97615877   nobody     600        1
0x00000000 97648646   nobody     600        1
0x00000000 97746953   vega       0          1
0x00000000 97779722   vega       0          1
0x00000000 97878027   vega       0          1
0x00000000 97910796   vega       0          1
0x00000000 98009101   vega       0          1
0x00000000 98041870   vega       0          1
0x00000000 98140175   vega       0          1
0x00000000 98172944   vega       0          1
0x00000000 98271249   vega       0          1
0x00000000 98304018   vega       0          1
0x00000000 98402323   vega       0          1
0x00000000 98435092   vega       0          1
0x00000000 98533397   vega       0          1
0x00000000 98566166   vega       0          1
0x00000000 98664471   vega       0          1
0x00000000 98697240   vega       0          1
0x00000000 98795545   vega       0          1
0x00000000 98828314   vega       0          1
0x00000000 98926619   vega       0          1
0x00000000 98959388   vega       0          1
0x00000000 99057693   vega       0          1
0x00000000 99090462   vega       0          1
0x00000000 99188767   vega       0          1
0x00000000 99221536   vega       0          1
0x00000000 99319841   vega       0          1
0x00000000 99352610   vega       0          1
0x00000000 99450915   vega       0          1
0x00000000 99483684   vega       0          1
0x00000000 99581989   vega       0          1
0x00000000 99614758   vega       0          1
0x00000000 99713063   vega       0          1
0x00000000 99745832   vega       0          1
0x00000000 99844137   vega       0          1
0x00000000 99876906   vega       0          1
0x00000000 99975211   vega       0          1
0x00000000 100007980  vega       0          1
0x00000000 100106285  vega       0          1
0x00000000 100139054  vega       0          1
0x00000000 100237359  vega       0          1
0x00000000 100270128  vega       0          1
0x00000000 100368433  vega       0          1
0x00000000 100401202  vega       0          1
0x00000000 100499507  vega       0          1
0x00000000 100532276  vega       0          1
0x00000000 100630581  vega       0          1
0x00000000 100663350  vega       0          1

but when I try to know further information about a certain semaphore-id I got this error

> ipcs -m -i 100663350
ipcs: shmctl failed: Invalid argument

The question is: how can I know which process is creating semaphores without removing them? Can I kill all semaphores with perms = 0 without affecting the system reliability?

Thank you all, Stefano

Stefano Radaelli
  • 1,088
  • 2
  • 15
  • 35

1 Answers1

1

I think what you're looking for is

ipcs -s -i 100663350

The -m flag is used to describe "shared memory segments". The -s flag is for "semaphore arrays". Since your initial call was to ipcs -s, the second column is listing "semid"s, which are values you could pass to ipcs -s -i <semid>.

Ariel Allon
  • 862
  • 2
  • 10
  • 15