使用ipcs -q可以得到key与msqid的对应关系,从而找到msgid
webadmin@172.172.179.3:/usr/local/webapps/test_ma[17:17:36]$ ipcs -q------ Message Queues --------key msqid owner perms used-bytes messages0x0bf4f5c9 0 appadmin 666 0 00x000d0001 32769 appadmin 666 0 00x000e0001 65538 appadmin 666 0 0
然后使用 ipcs -qp 可以得到进程id
webadmin@172.172.179.3:/usr/local/webapps/test[17:19:22]$ ipcs -qp------ Message Queues PIDs --------msqid owner lspid lrpid0 appadmin 2363 265732769 appadmin 0 065538 appadmin 0 098307 appadmin 2657 2363131076 appadmin 0 0163845 appadmin 0 0196614 appadmin 0 0