#1  
Old 11th April 2006, 11:49
linuxuser1 linuxuser1 is offline
Member
 
Join Date: Oct 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default auto start script

Hi

How to i make this to start automatically
5 * * * * /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l

Thanks.
Reply With Quote
Sponsored Links
  #2  
Old 11th April 2006, 15:05
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Do you want to have this as a cron job? Then run
Code:
crontab -e
and enter that line there.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 11th April 2006, 22:34
Aiken Aiken is offline
Junior Member
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by linuxuser1
Hi

How to i make this to start automatically
5 * * * * /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l

Thanks.
You realise that will run at 5 past every hour?

If you mean you want it to start when the box is restarted then some versions of cron (such as Redhat) support @reboot so your crontab entry would be
@reboot /opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l
Reply With Quote
  #4  
Old 12th April 2006, 12:29
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

If you want to start it at boot time, you simply create a script like /etc/init.d/jwwim_server_sql2:

Code:
#!/bin/bash
/opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l
Then run
Code:
chmod 755 /etc/init.d/jwwim_server_sql2
and create the necessary system startup links. Depending on your distribution you can do it with chkconfig (RedHat, Fedora, CentOS, Mandriva, SuSE) or update-rc.d (Debian, Ubuntu).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 16th June 2006, 08:00
reddog reddog is offline
Junior Member
 
Join Date: May 2006
Location: Chicago, IL. USA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
If you want to start it at boot time, you simply create a script like /etc/init.d/jwwim_server_sql2:

Code:
#!/bin/bash
/opt/jdk1.5.0_06/bin/java -jar /path/to/jwwim_server_sql2.jar localhost web1_db4 PASSWORD 5190 -l
Then run
Code:
chmod 755 /etc/init.d/jwwim_server_sql2
and create the necessary system startup links. Depending on your distribution you can do it with chkconfig (RedHat, Fedora, CentOS, Mandriva, SuSE) or update-rc.d (Debian, Ubuntu).

Can any program be made to run at startup? for example: a teamspeak server, and a counter strike server. As long as i use the startup commands for the respective servers, in the code?
Reply With Quote
  #6  
Old 16th June 2006, 18:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Quote:
Originally Posted by reddog
Can any program be made to run at startup? for example: a teamspeak server, and a counter strike server. As long as i use the startup commands for the respective servers, in the code?
Yes, of course.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 22nd May 2009, 13:58
atrias atrias is offline
Junior Member
 
Join Date: Jun 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

will the above run the commands as root ?
is there a way to create a delay ?
i need to start 2 programs and the first must be already started when the second starts.
i hope this works for centos 5 !
Reply With Quote
  #8  
Old 23rd May 2009, 14:12
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
 
Default

Quote:
Originally Posted by atrias View Post
will the above run the commands as root ?
Yes.

Quote:
Originally Posted by atrias View Post
is there a way to create a delay ?
i need to start 2 programs and the first must be already started when the second starts.
i hope this works for centos 5 !
You can either use the sleep command (see
Code:
man sleep
), or create two cron jobs where the second one is executed after the first one.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
normal HTTPD wont start traxxdata Installation/Configuration 4 1st February 2008 18:23
Script questions && Gentoo version hagel Feature Requests 4 7th May 2006 14:19
req: Bash / Script to auto kill PID if it's needed.... edge Programming/Scripts 8 14th March 2006 00:31
Suggestion: Use mySQL script for installation Dee General 1 17th February 2006 11:02
Internal Server Error 500 cgi script mphayesuk General 6 8th February 2006 23:53


All times are GMT +2. The time now is 12:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.