LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-26-2007, 01:50 AM   #1
dsubbarao
LQ Newbie
 
Registered: Jan 2007
Distribution: Redhat
Posts: 14

Rep: Reputation: 0
SUSE services


Hi all
I am new to linux environment. I want to run the java program as service. I could do that in Fedora linux system. but i am not able to do the same in SUSE. My code for init script is

#! /bin/sh
#
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Description: service to start the java program
### END INIT INFO


RETVAL=0



start() {
echo -n $"Starting Service: "
cd
source setJava --version 1.3
cd /home/nagios/GRE/GRE/
java -jar example.jar

}

stop() {
echo -n $"Stopping Service : "
pkill -f "java -jar example.jar"
RETVAL=$?
return $RETVAL
}
restart(){
stop
sleep 2
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
chkconfig Service

;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
exit $RETVAL

I don't want to run the service in any runlevel that is whenever i give command as "insserv myservice" then only my service should run.
That's the reason i have left the column " Default-Start: "

when i am adding it through "chkconfig -a /etc/init.d/myservice"
i am getting the excepion as" unknown service not a runlevel service"
Can u tell me where i have done the mistake.

Thanks in Advance
 
Old 03-26-2007, 02:01 AM   #2
Xian
Member
 
Registered: Feb 2004
Location: 33.31N -111.97W
Distribution: SuSE
Posts: 918

Rep: Reputation: 32
/etc/rc.d/skeleton is the openSUSE template for system service scripts.
Verify that you have met the specific guidelines provided.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SUSE-9.3 hangs after loading services. greythorne SUSE / openSUSE 2 09-19-2005 09:03 AM
stop services in SuSE 9.0 randomx Linux - General 2 12-29-2003 02:12 PM
Closing services on SuSE 8.2 - How? GloVe Linux - Security 3 09-30-2003 08:06 AM
configuring services on SuSE GloVe Linux - General 1 09-19-2003 04:47 PM
starting services in Suse 8.2? rje_NC Linux - Software 1 06-28-2003 02:35 AM


All times are GMT -5. The time now is 12:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration