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! |
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. |
Quote:
|
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.
|
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? |
Oh man, Who can help me?
|
/var/log/messages can be an admin's best friend. BTW does the file have execute perms?
|
All times are GMT -5. The time now is 10:28 PM. |