Confused about init scripts expectations
Jon Trauntvein
jon at campbellsci.com
Wed Feb 22 15:37:50 UTC 2006
Greetings,
I am developing a daemon application to handle datalogger communications.
I have developed the init script that is included at the bottom of this
mail based upon examples that I found on the web. This script runs very
well from the command line. However, when I attempt to use the gnome
server configuration tool to start csilgrnet, the tool locks up and has to
be aborted. I have searched in vain for guidelines for writing init
scripts and have no idea what the gui is looking for and not finding. Any
assistance or advise would be gratefully accepted.
Regards,
Jon Trauntvein
<begin-script>
#! /bin/sh
#
# csilgrnet
#
# chkconfig: 2345 90 60
# description: Campbell Scientific LoggerNet Server
# processname: csilgrnet
# config: /etc/opt/Campbellsci/csi_registry.xml
# pidfile: /var/run/csilgrnet.pid
# load the RedHat functions for supporting daemon processes.
. /etc/init.d/functions
RETVAL=0
start() {
echo -n "Starting LoggerNet Server: "
daemon /opt/CampbellSci/LoggerNet_3.3/csilgrnet
--coralib=/opt/CampbellSci/LoggerNet_3.3/libcoralib.so
--run-as-daemon=true
RETVAL=$?
touch /var/lock/subsys/csilgrnet
return $RETVAL
}
stop() {
echo -n "Stopping LoggerNet Server: "
killproc csilgrnet
RETVAL=$?
rm -f /var/lock/subsys/csilgrnet
return $RETVAL
}
rhstatus() {
status csilgrnet
}
restart() {
stop
start
}
reload() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/csilgrnet ] && restart
;;
*)
echo "Usage: csilgrnet { start|stop|status|restart|condrestart }"
exit 1
esac
exit $?
</end-script>
More information about the users
mailing list