LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2006, 02:00 PM   #1
alexandros
LQ Newbie
 
Registered: Apr 2005
Posts: 1

Rep: Reputation: 0
run java applications on startup


hi averybody
I have a problem i have slackware 10 installed on a server and i have a web application that runs on it so i want mysql tomcat and pserver(a server application that i have made) to be run when the pc is starting
i have made a script named rc.pns with the following lines

mysqld_safe --user=root --port=80
cd /root/pserver/
/root/jdk1.5.0_06/bin/java -classpath /root/pserver pserver.PersServer >server.l
/root/jakarta-tomcat-5.5.9/bin/startup.sh

comments
a)i dont care about security this time so i dont care about running mysql as root
b)/root/pserver/ is the path where pserver is installed

and i have putted in rc.M the linew

if [ -x /etc/rc.d/rc.pns ]; then
/etc/rc.d/rc.pns
fi

the problem is that mysql starts fine every time that my pc is starting up but the other two applications does not
I have tried to put every program (mysql, pserver, tomcat) is defferent rc files and put several lines in rc.M for its on of the programs nut i had the same results mysql runs bu the other two does not
Has anybody of you any idea this problem?
is there any problem about starting java applications on startup
 
Old 07-12-2006, 02:07 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Ther problem is that (at least for tomcat) you must define the JAVA_HOME env. varriable before runnig the 2 java apps. So you can modify your script like this:
Code:
mysqld_safe --user=root --port=80
cd /root/pserver/
export JAVA_HOME=/path/to/java
/root/jdk1.5.0_06/bin/java -classpath /root/pserver pserver.PersServer >server.l
/root/jakarta-tomcat-5.5.9/bin/startup.sh
Regards
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add applications to run at startup psteege Debian 2 01-22-2006 06:34 PM
startup applications allelopath Linux - General 5 08-18-2003 01:17 PM
startup applications?? graffitici Linux - Software 4 07-05-2003 11:19 AM
Loading startup applications? Goonie Linux - General 1 06-28-2003 09:48 PM
Startup Applications kronos Linux - General 1 05-15-2002 09:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration