]> git.pld-linux.org Git - projects/rc-scripts.git/blame - rc.d/init.d/<template>.init
- added "rm -rf /var/lock/subsys/<service>" in stop.
[projects/rc-scripts.git] / rc.d / init.d / <template>.init
CommitLineData
c4586185 1#!/bin/sh
2#
3# <service> <service> short service description
4#
5# chkconfig:
6#
7# description: <service> long service description
8
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13# Get network config
14. /etc/sysconfig/network
15
16# Get service config
17[ -f /etc/sysconfig/<service> ] && . /etc/sysconfig/<service>
18
19# Check that networking is up.
20if [ "${NETWORKING}" = "no" ]; then
21 echo "WARNING: Networking is down. <service> can't be runed."
22 exit 1
23fi
24
25
26# See how we were called.
27case "$1" in
28 start)
29 # Check if the service is already running?
30 if [ ! -f /var/lock/subsys/<service> ]; then
31 show "Starting <service> service"
32 daemon <service>
33 touch /var/lock/subsys/<service>
34 else
35 echo "<service> service is already running."
36 fi
37 ;;
38 stop)
39 # Stop daemons.
40 show "Stopping <service> service"
41 killproc <service>
3aa5f533 42 rm -rf /var/lock/subsys/<service>
c4586185 43 ;;
44 restart)
45 $0 stop
46 $0 start
47 ;;
48 reload)
49 if [ -f /var/lock/subsys/<service> ]; then
50 show "Reload <service> service"
51 busy
52 killproc <service> -HUP
53 deltext
54 ok
55 else
56 echo "<service> service is not running."
57 fi
58 ;;
59 status)
60 status <service>
61 ;;
62 *)
63 echo "Usage: $0 {start|stop|status|restart|reload}"
64 exit 1
65esac
66
67exit 0
68
This page took 0.029825 seconds and 4 git commands to generate.