This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Author Message
Joined: Sep 12, 2007
Posts: 2
Other Topics
Posted Sep 12, 2007 at 12:38:35 PM
Subject: /etc/init.d
Hi My PC/Server: Suse Linux 10.0 I want to write a script to start a service via /etc/init.d and i also want to start the standalone trac server tracd from console [url]http://trac.edgewall.org/[/url] My problem: first the service starts after booting and it is listet on the process list but it does not work. it only work if i kill the old process and make a new one. same with the tracd it only works as long as the console where i restated the service manuel is open. after closing the same problem appears how can i start such service? please help me
Back to top Profile Email Website
Joe Barr
Joined May 06, 2014
Posts: 146

Other Topics
Posted: Sep 12, 2007 1:45:08 PM
Subject: /etc/init.d
Please post your current script.
Back to top Profile Email
renegade22
Joined Sep 12, 2007
Posts: 2

Other Topics
Posted: Sep 12, 2007 2:00:59 PM
Subject: /etc/init.d
This script runns the python script the python script runns with os.system or commands.getoutput another bash script given as an argument. this script should create mod files on system works fine if i run the script by myself, but this server sould work without me the trac demon have the same problem Sourcecode --------------------------------------------- #! /bin/sh ### BEGIN INIT INFO # Provides: build # Required-Start: $syslog $remote_fs $ALL # Required-Stop: $syslog $remote_fs # X-UnitedLinux-Required-Start: $ALL # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Starts the buildserver ### END INIT INFO BUILDD_BIN=/usr/sbin/builddeamon.py test -x $BUILDD_BIN || { echo "$BUILDD_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } . /etc/rc.status rc_reset case "$1" in start) /sbin/startproc $BUILDD_BIN # Remember status and be verbose rc_status -v ;; stop) /sbin/killproc -TERM $BUILDD_BIN # Remember status and be verbose rc_status -v ;; try-restart|condrestart) ## Do a restart only if the service was active before. ## Note: try-restart is now part of LSB (as of 1.9). ## RH has a similar command named condrestart. if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi # Remember status and be quiet rc_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; force-reload) ## Signal the daemon to reload its config. Most daemons ## do this on signal 1 (SIGHUP). ## If it does not support it, restart the service if it ## is running. ## if it supports it: /sbin/killproc -HUP $BUILDD_BIN #touch /var/run/buildserver.pid rc_status -v ## Otherwise: #$0 try-restart #rc_status ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) # If it supports signaling: echo -n "Reload service buildserver " /sbin/killproc -HUP $BUILDD_BIN #touch /var/run/buildserver.pid rc_status -v ## Otherwise if it does not support reload: #rc_failed 3 #rc_status -v ;; status) echo -n "Checking for service buildserver " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Return value is slightly different for the status command: # 0 - service up and running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running (unused) # 4 - service status unknown :-( # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) # NOTE: checkproc returns LSB compliant status values. /sbin/checkproc $BUILDD_BIN # NOTE: rc_status knows that we called this init script with # "status" option and adapts its messages accordingly. rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, print out the ## argument to this init script which is required for a reload. ## Note: probe is not (yet) part of LSB (as of 1.9) test /etc/buildserver/buildserver.conf -nt /var/run/buildserver.pid && echo reload ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" exit 1 ;; esac rc_exit
Back to top Profile Email Website
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya