I have a program that leaves some semaphores uncleaned and hence if i run it a couple of times, the program will seg fault. I used to use the following command in linux to clean them up.
ipcs -s | grep root |grep 666| cut -f2 -d' ' | xargs -I {} sudo ipcrm -s {}
but this doesnt work on mac. What command should i use to resolve this issue in mac osx?
This worked for me on MacOS Ventura: I had to use an upper case -S
for the key (third entry in the table)
ipcs -s | grep root | cut -f3 -d' ' | xargs -I {} sudo ipcrm -S {}
and the lower case -s
with the id (second entry on the table)
ipcs -s | grep root | cut -f2 -d' ' | xargs -I {} sudo ipcrm -s {}
Replace root
with another username or any other filtering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With