标签:共享内存
c程序因共享内存引发的问题:
程序使用root启动过后,用普通用户无法启动,原因是root占据了共享内存,普通用户无法分配到共享内存
错误信息如下:
2016/09/05 18:52:39 - [pid: 6289][FATAL ERROR][qconf_agent.cc 147] - Failed to init share memory! 2016/09/05 18:52:39 - [pid: 6289][ERROR][qconf_agent.cc 103] - Failed to init qconf agent! 2016/09/05 18:52:39 - [pid: 3467][INFO][qconf_daemon.cc 164] - PID:6289 exited with exit_code:201 2016/09/05 18:52:40 - [pid: 3467][INFO][qconf_daemon.cc 135] - we try to keep alive for daemon process:6297 2016/09/05 18:52:40 - [pid: 3467][INFO][qconf_daemon.cc 150] - waiting for pid:6297 2016/09/05 18:52:40 - [pid: 6297][INFO][qconf_daemon.cc 126] - current child process id is 6297 2016/09/05 18:52:40 - [pid: 6297][FATAL ERROR][qconf_agent.cc 147] - Failed to init share memory! 2016/09/05 18:52:40 - [pid: 6297][ERROR][qconf_agent.cc 103] - Failed to init qconf agent! 2016/09/05 18:52:40 - [pid: 3467][INFO][qconf_daemon.cc 164] - PID:6297 exited with exit_code:201 2016/09/05 18:52:41 - [pid: 3467][INFO][qconf_daemon.cc 135] - we try to keep alive for daemon process:6305 2016/09/05 18:52:41 - [pid: 3467][INFO][qconf_daemon.cc 150] - waiting for pid:6305 2016/09/05 18:52:41 - [pid: 6305][INFO][qconf_daemon.cc 126] - current child process id is 6305 2016/09/05 18:52:41 - [pid: 6305][FATAL ERROR][qconf_agent.cc 147] - Failed to init share memory!
解决:
使用ipcs查看root使用的共享内存信息
[root@cloud-wd-comment-02 ~]# ipcs ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 644 131200012 38 dest 0x6c011111 196609 zabbix 600 292944 6 0x10cf21d1 229378 www 644 131200012 2
使用ipcrm -m 0 清除root占据的共享内存即可
本文出自 “明天过后” 博客,请务必保留此出处http://leeyan.blog.51cto.com/8379003/1846521
标签:共享内存
原文地址:http://leeyan.blog.51cto.com/8379003/1846521