Close

Delete all IPC objects

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 05/30/2020 at 22:510 Comments

Management of the audio interface is notoriously bad in Goog Chrome, so we've all adopted the same ritual in the 15 years since the Goog's IPO.

killall -9 google-chrome-stable chrome chrome-sandbox

Then, you have to run ipcs & ipcrm to delete all the IPC objects it leaves behind, one by one.  Goog employees don't know how to properly delete shared memory when their programs crash.  For those of us not completely focused on passing interview questions with leetcoding, the secret is to call 

shmctl(shmid, IPC_RMID, 0);

right after calling 

shmat(shmid, NULL, 0);

But anyways, it was finally time to automate this process.

https://cdn.hackaday.io/files/1380505906331200/ipcclean.c

This program just deletes every IPC object.  It has to be run as root.

.  

Discussions