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 do I start a script upon booting

Discussion in 'General Discussion' started by baidarkabob, Jul 8, 2005.

  1. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Hi,

    I have a script that I would like to be started when the server reboots. How do I do this?

    Thanks for your help.

    Bob
     
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    put the script in /etc/init.d then make a link to the script in /etc/rc2.d or /etc/rc3.d
     
  3. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Thanks for the prompt reply

    Hi, and thanks for the reply.

    The script is only relevant to one account and currently resides in /home/account_name/public_html/crittermail/batch/tools - I don't think it will work properly if I move it. So, do I need to make a link in /etc/rc3.d to the current location? How do I make a link?

    Thanks again.

    Bob
     
  4. Blue|Fusion

    Blue|Fusion Well-Known Member

    Joined:
    Sep 12, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    You can also put a command in the /etc/rc.local file
     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    yep in that case put it in rc.local
     
  6. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Thanks again.

    Thanks guys,

    Do I just create a line with the full path to the script or do i need to include a command of some sort? run? start? go?

    Sorry, I am pretty new to this.

    This is the full path

    /home/account_name/public_html/crittermail/batch/tools/gpopd.pl

    Bob
     
  7. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    if your script will run as root using the command
    /home/account_name/public_html/crittermail/batch/tools/gpopd.pl

    yes.

    Else you may need to fix the script or make it executable
     
  8. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Thanks again Albert.

    Bob
     
Loading...

Share This Page