LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2004, 03:36 AM   #1
kodaku
LQ Newbie
 
Registered: Mar 2004
Location: Xuzhou,China.
Posts: 16

Rep: Reputation: 0
HOWTO autorun a program on start up?


Hi everyone! I'm completely new in Linux and easily got into trouble.
Now my question is: HOWTO autorun a program on start up? I've got a webserver software(not apache) and it is located in /root/webserver/linux/ and the program's name is "webs", I want it to autorun on start up by adding certant shell scripts somewhere but I don't know how. Somebody help? Thanks in advance!
 
Old 08-12-2004, 03:49 AM   #2
Lucidion
LQ Newbie
 
Registered: Aug 2004
Distribution: Debian
Posts: 3

Rep: Reputation: 0
This can be pretty distro specific. They're normally in the /etc/rc.d/* directories. This is probably best done by copying and editing one of the scripts in /etc/init.d/ to start, stop and restart your webserver, copying and editing one of the scripts in /etc/rc.d/* to start the webserver and one to stop the webserver and copying your webserver into /usr/local/bin/

The following may help (I've only skimmed it)

http://www.linuxvoodoo.com/resources/howtos/sysvinit/

If you can find a distro specific package for this program, it would probably make it much easier for you.
 
Old 08-12-2004, 04:06 AM   #3
kodaku
LQ Newbie
 
Registered: Mar 2004
Location: Xuzhou,China.
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Lucidion
This can be pretty distro specific. They're normally in the /etc/rc.d/* directories. This is probably best done by copying and editing one of the scripts in /etc/init.d/ to start, stop and restart your webserver, copying and editing one of the scripts in /etc/rc.d/* to start the webserver and one to stop the webserver and copying your webserver into /usr/local/bin/

The following may help (I've only skimmed it)

http://www.linuxvoodoo.com/resources/howtos/sysvinit/

If you can find a distro specific package for this program, it would probably make it much easier for you.
Hi Lucidion,Thank you very much for your reply but seems that here I can't open the link you've given. I'm trying your method but I don't know whether It makes sense to me or not.
 
Old 08-12-2004, 04:23 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
As Lucidon said, the startup script locations are pretty distro specific. If you can disclose the distro you are currently working on, solutions will flow.
 
Old 08-12-2004, 07:49 AM   #5
kodaku
LQ Newbie
 
Registered: Mar 2004
Location: Xuzhou,China.
Posts: 16

Original Poster
Rep: Reputation: 0
Well.Now I got another server which comes along with a shell like follows:
#! /bin/sh
#
# /etc/init.d/boa -- start/stop Boa HTTP server
#
# This file was automatically customized by debmake on Mon, 23 Dec 1996 20:27:43 -0800
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>
# Modified for Debian GNU/Linux by Jonathon Nelson <jnelson@boa.org>

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/boa
# update-rc.d option extracted by debstd to generate postinst on package build
FLAGS="defaults 50"

test -f $DAEMON || exit 0
ALIVE=`ps axw | grep "/usr/sbin/boa *\$" | awk '{print $1}'`
#ALIVE=`pidof $DAEMON`
WAIT=30

case "$1" in
start)
echo -n "Starting HTTP server: Boa"
start-stop-daemon --start --quiet --exec $DAEMON
echo "."
;;
stop)
echo -n "Stopping HTTP server: Boa"
start-stop-daemon --stop --quiet --exec $DAEMON
sleep 1
start-stop-daemon --stop --quiet --signal INT --exec $DAEMON
echo "."
;;
force-reload)
echo -n "Forcing reload of HTTP server: Boa"
start-stop-daemon --stop --quiet --signal HUP --exec $DAEMON
echo "."
;;
restart)
echo -n "Restarting HTTP server: Boa"
if [ -n "$ALIVE" ];
then
start-stop-daemon --stop --quiet --exec $DAEMON
$DAEMON
# start-stop-daemon --start --quiet --exec $DAEMON
echo "."
else
echo ". Boa not running! Not attempting restart."
fi
;;
*)
echo "Usage: /etc/init.d/boa {start|stop|restart|force-reload}"
exit 1
;;
esac

exit 0

The filename is boa.init
I did as follows:
copy it to /etc/rc.d/init.d/
then make links:
ln -s /etc/init.d/boa.init /etc/rc3.d/S99boa
ln -s /etc/init.d/boa.init /etc/rc0.d/K01boa

then I restart the computer.BUT seems that boa isn't started!! what seems to be the problem?
 
Old 08-12-2004, 09:09 PM   #6
kodaku
LQ Newbie
 
Registered: Mar 2004
Location: Xuzhou,China.
Posts: 16

Original Poster
Rep: Reputation: 0
Oh man, Who can help me?
 
Old 08-12-2004, 09:40 PM   #7
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
/var/log/messages can be an admin's best friend. BTW does the file have execute perms?
 
  


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
howto start a program automatic linuxtesting2 Linux - General 4 06-30-2004 08:44 AM
Howto start bash Christoffer81 Linux - Newbie 5 06-13-2004 01:19 AM
AutoRun Program in XWindows zael Linux - Newbie 3 02-09-2004 06:49 AM
autorun application program on hotplug kevinatkins Linux - Software 0 02-08-2004 07:44 AM
autorun a program in tty3 LynX Linux - Newbie 2 11-09-2002 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:37 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