]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Template init script.
authorkloczek <kloczek@pld-linux.org>
Mon, 6 Mar 2000 00:10:46 +0000 (00:10 +0000)
committerkloczek <kloczek@pld-linux.org>
Mon, 6 Mar 2000 00:10:46 +0000 (00:10 +0000)
This script can be used for preparing some unified
output messages translation for other init scripts for all services)

Also it would be good to change all other init scripts for compatybility
with this skeleton script and/or keep this file as template.

svn-id: @653

rc.d/init.d/<template>.init [new file with mode: 0644]

diff --git a/rc.d/init.d/<template>.init b/rc.d/init.d/<template>.init
new file mode 100644 (file)
index 0000000..1a761e3
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# <service>    <service> short service description
+#
+# chkconfig:   
+#
+# description: <service> long service description
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/<service> ] && . /etc/sysconfig/<service>
+
+# Check that networking is up.
+if [ "${NETWORKING}" = "no" ]; then
+       echo "WARNING: Networking is down. <service> can't be runed."
+       exit 1
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/<service> ]; then
+               show "Starting <service> service"
+               daemon <service>
+               touch /var/lock/subsys/<service>
+       else
+               echo "<service> service is already running."
+       fi
+        ;;
+  stop)
+        # Stop daemons.
+        show "Stopping <service> service"
+       killproc <service>
+        ;;
+  restart)
+        $0 stop
+       $0 start
+        ;;
+  reload)
+       if [ -f /var/lock/subsys/<service> ]; then
+               show "Reload <service> service"
+               busy
+               killproc <service> -HUP
+               deltext
+               ok              
+       else
+               echo "<service> service is not running."
+       fi
+       ;;
+  status)
+       status <service>
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|status|restart|reload}"
+        exit 1
+esac
+
+exit 0
+
This page took 0.044649 seconds and 4 git commands to generate.