Chinaunix首页 | 论坛 | 博客
  • 博客访问: 813540
  • 博文数量: 120
  • 博客积分: 7531
  • 博客等级: 少将
  • 技术积分: 1253
  • 用 户 组: 普通用户
  • 注册时间: 2005-10-11 12:18
文章分类

全部博文(120)

文章存档

2013年(1)

2012年(7)

2011年(1)

2010年(7)

2009年(15)

2008年(13)

2007年(22)

2006年(45)

2005年(9)

分类: 系统运维

2006-09-25 14:11:11

 
apache2.0,重启apache后eroor.log报:
Mon Sep 25 10:35:59 2006] [crit] (17)File exists: unable to createscoreboard "/var/apache/logs/httpd.sco
reboard" (name-based shared memory failure)
[Mon Sep 25 10:37:09 2006] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Sep 25 10:37:09 2006] [warn] pid file /var/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
问题是共享内存的问题.
 
引用网上的解决方法:
 

How do I fix the problem?
To fix the problem without requiring a system restart we need to find the orphan shared memory segment. To do this we need to use the ipcs command as root to list allocated segments. On my normal system the shared memory usage would look like the following:

[root@hacksaw /]# ipcs -m -p

------ Shared Memory Creator/Last-op --------
shmid owner cpid lpid
0 root 1006 12254
327681 hacksaw 8640 8641
262146 hacksaw 1405 1205
294915 hacksaw 1408 1414
360452 chainsaw 8724 8732

[root@hacksaw hacksaw]# ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0101f3fe 0 root 600 56344 14
0x00000000 327681 hacksaw 600 393216 2 dest
0x00000000 262146 hacksaw 600 393216 2 dest
0x00000000 294915 hacksaw 600 393216 2 dest
0x00000000 360452 chainsaw 600 393216 2 dest


You will notice 14 attached proceses (nattach) to the first shared memory segment (segment 0). These are the 14 httpd threads waiting for incoming http requests. Now here is what it looks like after the failure to restart:


[root@hacksaw /]# ipcs -m -p

------ Shared Memory Creator/Last-op --------
shmid owner cpid lpid
0 root 1006 1109
327681 hacksaw 8640 8641
262146 hacksaw 1405 1205
294915 hacksaw 1408 1414
360452 chainsaw 8724 8732

[root@hacksaw /]# ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0101f3fe 0 root 600 56344 0
0x00000000 327681 hacksaw 600 393216 2 dest
0x00000000 262146 hacksaw 600 393216 2 dest
0x00000000 294915 hacksaw 600 393216 2 dest
0x00000000 360452 chainsaw 600 393216 2 dest



Notice that there are no attached clients to the first segment (identified by shmid 0). Apache had a failure on shutdown and did not clean up after itself. Just to make sure we can do a
ps command and look to see if the process id associated with the memory segment exists.

[root@hacksaw /]# ps 1006
PID TTY STAT TIME COMMAND
[root@hacksaw /]#


Now we remove the shared memory associated with ID 0 using the ipcrm command.

[root@hacksaw /]# ipcrm -m 0


As we can see in the below output the memory segment has been removed. We can now restart apache successfully.

[root@hacksaw /]# ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 327681 hacksaw 600 393216 2 dest
0x00000000 262146 hacksaw 600 393216 2 dest
0x00000000 294915 hacksaw 600 393216 2 dest
0x00000000 360452 chainsaw 600 393216 2 dest

 
解决方法:
1.查看共享内存使用情况.
[root@localhost logs]# ipcs   -m
 

key        shmid      owner      perms      bytes      nattch     status

0x00000000 2129920    nobody    600        640        16

0x00000000 2162689    nobody    600        640        16

0x01027191 1769474    root      600        209176     0

0x01027192 1966083    root      600        209176     0

0x01027193 2097156    root      600        209176     0

 

2.删除nattch为0的share memory

 

[root@localhost logs]# ipcrm shm 1769474

 
 
 
阅读(4425) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~