LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-26-2006, 03:30 PM   #1
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Rep: Reputation: 15
Question wildfire to start with suse - how to edit init.d


hello all. i've running the jabber server, wildfire on a suse linux enterprise server 9. i would like for this service to start on boot if the system is restarted.

is there a way to add this software into the yast runlevel editor so that i can set it to start at system load?

it's currently not a "service" like apache2 or mysql, it's run path is currently '/opt/wildfire/bin/wildfire <start/stop/restart>'

what run level would i be looking at? is runlevel 3 the most common for this sort of application? i see apache2 and mysqld are both set at runlevel3.

thanks for your .

Last edited by winkydo; 12-26-2006 at 07:55 PM.
 
Old 12-26-2006, 04:11 PM   #2
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
i think i might have solved my own problem here with the help of a colleague.

i created a script called S33wildfire in /etc/init.d/rc3.d. this script runs...
Code:
/opt/wildfire/bin/wildfire start
then i created a script called K33wildfire in /etc/init.d/rc3.d. this script runs...
Code:
/opt/wildfire/bin/wildfire stop
now, because the init runs as root, this should allow the wildfire service to be stopped and started when the system hits and leaves runlevel 3. with the mysql database needed being stopped and started in runlevel 2.

Last edited by winkydo; 12-26-2006 at 04:14 PM.
 
Old 12-26-2006, 05:00 PM   #3
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
this did not work...

i also created a script called wildfire in the /etc/init.d...
Code:
case "$1" in
start)
        /opt/wildfire/bin/wildfire
        ;;
stop)
        /opt/wildfire/bin/wildfire
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
exit 0
after doing a 'chmod +x wildfire' i then created links in the /etc/init.d/rc3.d directory named S33wildfire and K33wildfire.

the "service" is still not starting at system boot.

i must be overlooking something.
 
Old 12-26-2006, 05:32 PM   #4
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
double post

Last edited by winkydo; 12-26-2006 at 05:49 PM.
 
Old 12-26-2006, 05:33 PM   #5
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
with the above wildfire script in /etc/init.d/ i can run './wildfire start' and './wildfire stop' just fine, as if i was running the '/opt/wildfire/bin/wildfire start/stop' commands.

whenever i create links in the rc3.d directory using 'ln ./wildfire ./rc3.d/S33wildfire' and try to run them with or without stop and start, i get...

Code:
imsrv:/etc/init.d/rc3.d # ./S33wildfire stop
./K33wildfire: line 1: e: command not found
./K33wildfire: line 2: syntax error near unexpected token `)'
./K33wildfire: line 2: `start)'
and

Code:
imsrv:/etc/init.d/rc3.d # ./S33wildfire
./S33wildfire: line 1: e: command not found
./S33wildfire: line 2: syntax error near unexpected token `)'
./S33wildfire: line 2: `start)'

Last edited by winkydo; 12-26-2006 at 05:48 PM.
 
Old 12-26-2006, 06:12 PM   #6
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
it was suggested i retype the wildfire script by hand because i had copied it from my windows box to vi on putty. it picked up some hidden characters. this is the script i went with, which worked with '/etc/init.d/rc3.d/S33wildfire'.

Code:
#!/bin/sh
case "$1" in
start)
        /opt/wildfire/bin/wildfire
        ;;
stop)
        /opt/wildfire/bin/wildfire
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
exit 0
now, to get it to actually work like a init script.

Code:
imsrv:/etc/init.d # ./rc3.d/S33wildfire
Usage: ./rc3.d/S33wildfire { start | stop }
 
Old 12-26-2006, 06:29 PM   #7
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
hahahaha... ok. with the '/opt/wildfire/bin/wildfire' lines in the script, i have to include the "stop" and "start" variable at the end, so the box knows WTF it's doing.



now, i got init 2 to bring the server down, and when i goto init 3, it comes back up.

now, to get the system reboot to start and stop the wildfire "service"...
 
Old 12-26-2006, 06:42 PM   #8
winkydo
Member
 
Registered: Jan 2005
Location: fort worth, tx
Distribution: fedora core
Posts: 30

Original Poster
Rep: Reputation: 15
the simple fix in the end was to add the links to /rc5.d/ as well as /rc3.d/.

stupid linux.

so this is how you make a random script run at system load time.
 
  


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
LXer: Review of Jive Software's Wildfire IM Server, v 3.1.1 LXer Syndicated Linux News 0 12-07-2006 08:03 PM
LXer: Jive Software Releases Wildfire 3.0 Open Source Edition LXer Syndicated Linux News 0 07-13-2006 03:33 AM
Pro engineer Wildfire senttrox Linux - Software 5 01-03-2006 04:54 PM
How do i change from Runlevel5 to Runlevel3? FunkFlex Linux - General 9 04-16-2002 12:39 PM
How do I boot to runlevel3 from GRUB ? amp2000 Linux - General 3 02-13-2002 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:32 PM.

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