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.

How to add services to the Service Monitor?

Discussion in 'General Discussion' started by spaceman, Dec 6, 2003.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    I've got some payment gateway merchant server software installed on my redhat linux 7.2 machine running latest versions of WHM+cPanel.

    This merchant server software needs to be running all the time (obviously) if it's always going to be available to process online payments from the various websites that use it.

    How do I

    a) Ensure that when (for whatever reason) my machine is restarted that the merchant server software is always started up along with all the other essential services, and
    b) Ensure that if (for any reason) the merchant software stops, then this failure is detected and the system attempts to 'automagicaly' restart it (and keeps on attempting/reporting until it does).

    I'm not sure if this is entirely a command line thing (which is fine) or whether some or all of it can be achieved via WHM.

    Thanks for any help or guidance. This is probably a bit of a newbie question for more experienced webserver admins.
     
  2. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    anyone? :)
     
  3. jphilipson

    jphilipson Well-Known Member

    Joined:
    Jan 8, 2003
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    YOu can add it to the checkservd by adding a file for it in /etc/chkserv.d/

    you can look at the files in thier to get an idea of the format, but its basically ..

    #SERVICE = PORT, SEND, RESPONSE, RESTART COMMAND

    so would possibly be something likethis (assuming it is running as a service)

    service[gateway]=x,x,x,/path/to/command/tostartgateway
     
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Thanks! I'll take a look...
     
  5. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    At the risk of straining the friendship :), is there a way of testing a new file that I put in /etc/chkserv.d/ without actually rebooting the server and/or stopping the service in question?

    Also, assuming that I've correctly adding a new file in /etc/chkserv.d/, what are the characteristics of the chkserv daemon? For example, does it regularly check that the service in question is running (if so, how often) and attempts to re-start it if not - or does it only kick-in a server restart?

    Thanks - your guidance is very much appreciated.
     
  6. jphilipson

    jphilipson Well-Known Member

    Joined:
    Jan 8, 2003
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    the checkservd runs every five minutes.. so kill the gateway script, then wait +/- 5 minutes and see if it gets restarted

    but if you leave the PORT, SEND and RESPONSE feilds blank, t won't test to see if its running, it will just restart the program
     
  7. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Brilliant! Thanks mate, you've been really helpful.

    P.S. Merry Xmas from Perth, Australia! It should be in high 30s celsius for Xmas Day so a white christmas looks unlikely :)
     
  8. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    I've just noticed this directory:

    /etc/chkserv.d/not/

    What's the signficance of the 'not' directory within the chkserv.d directory?

    For example, both these files have the same content:

    /etc/chkserv.d/proftpd
    /etc/chkserv.d/not/proftpd

    Thanks.
     
Loading...

Share This Page