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 to create a restart Script

Discussion in 'General Discussion' started by xp2u, May 11, 2003.

  1. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    156
    How to create a restart script for Tom_Cat?

    #!/usr/bin/perl
    system("usr/sbin/stoptomcat");
    system("usr/sbin/starttomcat");
    exit;

    After that I chmod filename 755

    I put the filename in /scripts/

    Can I execute /scripts/filename to call for restart tomcat?

    Please help.......
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    191
    Why don't you use WHM? Are you wanting to create a cron job or something?
     
  3. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    156
    Ya

    Ya I want to create a cron job and also other purpose like adding to my reseller WHM so that particular reseller can restart Tom-Cat too.

    If you guy knows how, please help..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    191
    There's already a script for restarting tomcat. You could probably create a cron job for it as follows:


    lynx -cookies -dump -auth=root:your_root_password_here http://your_main_server_ip_here:2086/scripts/restomcat


    all the above on one line in your Control panel cron manager.

    Minute Hour Day Month Weekday

    0 0 * * *

    That would restart it every night at midnight. Modify as needed.
     
    #4 casey, May 11, 2003
    Last edited: May 11, 2003
  5. xp2u

    xp2u Active Member

    Joined:
    Jan 27, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    156
    /scripts/restomcat

    /scripts/restomcat is actually not working. I have tried this. there is no such script restomcat in /scripts/ direcotry.

    I need to set to my reseller WHM or cpanel too. So, I need a script to work around since /scripts/restomcat is not functioning
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,574
    Likes Received:
    3
    Trophy Points:
    343
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Try this

    0 0 * * * /usr/sbin/stoptomcat;/usr/sbin/starttomcat

    That should work, which is basically what the whm and the restart sript do.
     
    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