The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Detect easyapache running

Discussion in 'EasyApache' started by hellnux, Aug 4, 2011.

  1. hellnux

    hellnux Registered

    Joined:
    Aug 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I create a shell script, but this script can not execute when easyapache running.

    With a simple "ps aux | grep easyapache" is not 100% functional, it seems that easyapache executes several other commands.

    Have any way to find if the easypache is running without the "ps aux | grep easyapache"? Like A PID, lock file, etc.

    Thanks!
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    When EasyApache is running, this file will exist:

    /usr/local/apache/AN_EASYAPACHE_BUILD_IS_CURRENTLY_RUNNING

    Your script could simply check for the existence of that file.
     
  3. hellnux

    hellnux Registered

    Joined:
    Aug 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for answer cPanelTristan.

    I run a command /scripts/easyapache --build , but a file AN_EASYAPACHE_BUILD_IS_CURRENTLY_RUNNING has created ~3 minutes later.

    Have any way to find if the easypache is running, since the beginning to the end of execution?

    WHM 11.30.2 (build 1)
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The build isn't considered to be running until that file has been created. This is the only way I know to check for EasyApache running. Put a time delay in your script if necessary to do a recheck after 5 minutes otherwise.
     
  5. hellnux

    hellnux Registered

    Joined:
    Aug 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    My script is running in 20 to 20 seconds, if i increase delay, i'm end the usefulness of the script. When i apply /scripts/easyapache --build, apparently all process of apache is down, because "ps aux | grep httpd" returning nothing, thus activating my script.

    Anyway, thanks for explanation.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What is your script doing exactly? It is restarting Apache when it is down, which many other scripts accomplish including chkservd if you monitor Apache in it?
     
  7. hellnux

    hellnux Registered

    Joined:
    Aug 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Is one of the features of the script, unfortunately this is one feature that i can talk, but the purpose is to keep apache on.

    I do not know the chkservd yet.

    Thanks.
     
Loading...

Share This Page