用以下命令可以查看所有的信号量:
# ipcs -s
------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 19234816 nobody 600 1
0x00000000 19267585 nobody 600 1
0x00000000 19300354 nobody 600 1
0x00000000 19398659 nobody 600 1
0x00000000 19431428 nobody 600 1
0x00000000 19464197 nobody 600 1
0x00000000 19562502 nobody 600 1然后用这行命令删除所有的信号量即可:
ipcs -s | grep nobody | perl -lane 'print `ipcrm sem $F[1]`'