P r o f e s s i o n a l — M a n a g e m e n t — S o l u t i o n s
RSS icon Email icon Home icon
  • #Apache Down Frequently or Failed#

    Posted on December 7th, 2007 Admin No comments

    “Getting Apache error @ /var/log/httpd/error.logcritical_create(): semget() failed: No space left on device or pid file /usr/local/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run?”

    Solution: Hi, You don’t really have to reboot your server. It’s a kernel thing.

    RUN This Command:- ipcs
    You will get a output like this: Message Queues:
    ——————————————————————————————-
    root@host [~]# ipcs
    —— Shared Memory Segments ——–
    key shmid owner perms bytes nattch status
    0×00000000 202047488 root 600 524288 12 dest
    0×00000000 202080257 root 600 368644 12 dest
    —— Semaphore Arrays ——–
    key semid owner perms nsems
    0×00000000 21135360 nobody 600 1
    0×00000000 21168129 nobody 600 1
    0×00000000 21299202 nobody 600 1
    0×00000000 21692419 nobody 600 1
    0×00000000 21725188 nobody 600 1
    0×00000000 21790725 nobody 600 1
    0×00000000 22085638 nobody 600 1
    0×00000000 22118407 nobody 600 1
    0×00000000 22216712 nobody 600 1
    —— Message Queues ——–
    key msqid owner perms used-bytes messages
    ——————————————————————————————-
    apache’s not up and running, you can “ipcrm” them like this:
    ipcrm -s 21135360
    /usr/local/apache/bin/apachectl restart

    ——————————————————————————————-
    The Apache claims ‘no space on device’ Keywords apache ipcs semaphore no space on device lock accept A message appears in the server log files, e.g.: [emerge] (28) No space left on device: Couldn’t create accept lock or [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed. This is caused by the system running out of space to store semaphores, which is usually limited by the operating system on a per user basis. To list the memory used by these semaphore arrays for user nobody do:

    ipcs -s | grep nobody

    Kill all the IDs listed using following command and restart the apache with SSL.

    ipcrm -s ID For Example:- ipcrm -s 21135360

    that fixed the issue
    ——————————————————————————————-
    What is “SEMAPHORE”?

    DEFINITION – In programming, especially in Unix systems, semaphores are a technique for coordinating or synchronizing activities in which multiple processes compete for the same operating system resources. A semaphore is a value in a designated place in operating system (or kernel) storage that each process can check and then change. Depending on the value that is found, the process can use the resource or will find that it is already in use and must wait for some period before trying again. Semaphores can be binary (0 or 1) or can have additional values. Typically, a process using semaphores checks the value and then, if it using the resource, changes the value to reflect this so that subsequent semaphore users will know to wait. Semaphores are commonly use for two purposes: to share a common memory space and to share access to files. Semaphores are one of the techniques for interprocess communication (IPC). The C programming language provides a set of interfaces or “functions” for managing semaphores.

     

    Regards,
    Steven.

    http://24×7servermanagement.com
    sales@24×7servermanagement.com

    Share/Save/Bookmark

    Leave a reply

    You must be logged in to post a comment.