File: init.d.redhat

package info (click to toggle)
srcpd 2.1.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,900 kB
  • sloc: ansic: 18,080; sh: 4,579; makefile: 95
file content (83 lines) | stat: -rwxr-xr-x 1,427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# init file for srcpd
#
# Author: Guido Scholz <gscholz@users.sourceforge.net>
#
# chkconfig: - 50 50
# description: Simple Railroad Command Protocol (SRCP) Daemon
#
# processname: /usr/sbin/srcpd
# config: /etc/srcpd.conf
# pidfile: /var/run/srcpd.pid

# source function library
. /etc/init.d/functions

OPTIONS=""
RETVAL=0
prog="srcpd"

start() {
        echo -n $"Starting $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                daemon /usr/sbin/srcpd $OPTIONS
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/srcpd
        fi;
        echo 
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                killproc /usr/sbin/srcpd
                RETVAL=$?
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/srcpd
        fi;
        echo
        return $RETVAL
}

reload(){
        echo -n $"Reloading $prog: "
        killproc /usr/sbin/srcpd -HUP
        RETVAL=$?
        echo
        return $RETVAL
}

restart(){
	stop
	start
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	restart
        ;;
  reload)
	reload
        ;;
  status)
        status srcpd
	RETVAL=$?
        ;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload}"
	RETVAL=1
esac

exit $RETVAL