Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    507
    Likes Received:
    4
    Trophy Points:
    168
    put the script in /etc/init.d then make a link to the script in /etc/rc2.d or /etc/rc3.d
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    166
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Blue|Fusion

    Blue|Fusion Well-Known Member

    Joined:
    Sep 12, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    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:
    507
    Likes Received:
    4
    Trophy Points:
    168
    yep in that case put it in rc.local
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    166
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    507
    Likes Received:
    4
    Trophy Points:
    168
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. baidarkabob

    baidarkabob Well-Known Member

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

    Bob
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice