]> git.pld-linux.org Git - packages/lms.git/commitdiff
- lms.init for almsd daemon
authordomelu <domelu@pld-linux.org>
Thu, 7 Oct 2004 17:46:18 +0000 (17:46 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lms.init -> 1.1

lms.init [new file with mode: 0644]

diff --git a/lms.init b/lms.init
new file mode 100644 (file)
index 0000000..8c507e9
--- /dev/null
+++ b/lms.init
@@ -0,0 +1,65 @@
+#!/bin/sha
+#
+# Startup script for lms (almsd)
+#
+# Adam Nowotny <domelu@pld-linux.org>
+#
+# chkconfig:   2345 90 15
+# description: almsd daemon for LMS
+# processname: almsd
+# config:      /etc/sysconfig/lms
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down almsd
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+# Get service config
+if [ -f /etc/sysconfig/lms ]; then
+       . /etc/sysconfig/lms
+fi
+
+RETVAL=0
+case "$1" in
+  start)
+       if [ ! -f /var/lock/subsys/lms ]; then
+               msg_starting lms
+               daemon "almsd-$ALMSD_DATABASE_TYPE -b > /dev/null 2>&1 &"
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lms
+       else
+               msg_already_running lms
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/lms ]; then
+               msg_stopping lms
+               killproc almsd-$ALMSD_DATABASE_TYPE
+               sleep 1
+               rm -f /var/lock/subsys/lms >/dev/null 2>&1
+       else
+               msg_not_running lms
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.097101 seconds and 4 git commands to generate.