I'm writing some code to replace TCP sockets with POSIX message queues. Sometimes the program will crash (still in development) and the queues that were created are not deleted (did not execute: mq_close()
+ mq_unlink()
). This causes issues when I run the code again.
Is there a way to delete/remove these queues using the command line? I tried using: ipcs -q
. This failed to list any queues.
I tried: lsof | grep queue-name
. They did show up here.
Ideally, I'd like to use: ipcrm
.
POSIX IPC objects are implemented as files in virtual file systems. These files can be listed and removed with ls and rm. To do this with POSIX message queues, we must mount the message queue file system using the following commands: