3 # <service> <service> short service description
5 # chkconfig: 345 <start_level> <stop_level>
7 # description: <service> long service description
9 # processname: <service>
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
27 # Get service config - may override defaults
28 [ -f /etc/sysconfig/<service> ] && . /etc/sysconfig/<service>
30 # Check that networking is up.
31 if is_yes "${NETWORKING}"; then
32 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
33 msg_network_down <service>
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/<service> ]; then
43 msg_starting <service>
44 daemon /usr/sbin/<service>
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/<service>
48 msg_already_running <service>
53 if [ -f /var/lock/subsys/<service> ]; then
55 msg_stopping <service>
57 killproc --pidfile /var/run/<service>.pid <service> -TERM
58 rm -f /var/lock/subsys/<service>
60 msg_not_running <service>
65 if [ -f /var/lock/subsys/<service> ]; then
66 msg_reloading <service>
67 killproc <service> -HUP
68 killproc --pidfile /var/run/<service>.pid <service> -HUP
71 msg_not_running <service>
77 if [ -f /var/lock/subsys/<service> ]; then
81 msg_not_running <service>
87 # See how we were called.
102 # include force-reload here if program allows reloading without restart
103 # otherwise remove reload action and support force-reload as restart if running
107 # use this one if program doesn't support reloading without restart
116 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"