-
Notifications
You must be signed in to change notification settings - Fork 32
/
gMaxLinkedd
60 lines (53 loc) · 1.01 KB
/
gMaxLinkedd
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
#!/bin/sh
#
# gMaxLinkedd
#
# chkconfig: - 80 20
# processname: gMaxLinked
# config: /etc/gMaxLinked.conf
# pidfile: /var/run/gMaxLinked.pid
# description: Starts and stops the gMaxLinked daemon.
# Source function library.
. /etc/rc.d/init.d/functions
name=gMaxLinked
run=${RUN-/usr/local/sbin/gMaxLinked}
config=${CONFIG-/etc/gMaxLinked.conf}
pidfile=${PDIFILE-/var/run/gMaxLinked.pid}
lockfile=${LOCKFILE-/var/lock/subsys/gMaxLinked}
start() {
[ -f $config ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name..."
daemon --pidfile=${pidfile} ${run}
ret=$?
echo
[ $ret -eq 0 ] && touch ${lockfile}
return $ret
}
stop() {
echo -n $"Stopping $name..."
killproc -p ${pidfile} ${name}
ret=$?
echo
[ $ret -eq 0 ] && rm -f ${lockfile} ${pidfile}
return $ret
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $name {start|stop|restart}"
exit 1
esac
exit $?