-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.d_AcsSearch
87 lines (77 loc) · 1.61 KB
/
init.d_AcsSearch
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
84
85
86
87
#!/bin/bash
#
# AcsSearch This shell script takes care of starting and stopping
# AcsSearch.
#
# chkconfig: - 58 74
# description: AcsSearch
### BEGIN INIT INFO
# Provides: AcsSearch
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $syslog $named
# Should-Stop: $syslog $named
# Short-Description: start and stop AcsSearch
# Description: AcsSearch
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source AcsSearch configuration.
[ -f /etc/sysconfig/AcsSearch] && . /etc/sysconfig/AcsSearch
prog=AcsSearch
lockfile=/var/lock/subsys/$prog
pidfile=/var/run/acssearch.pid
executable="/usr/bin/java"
start() {
[ "$EUID" != "0" ] && exit 4
[ "$NETWORKING" = "no" ] && exit 1
[ -x "$executable" ] || exit 5
# Start daemon.
echo -n $"Starting $prog: "
cd /opt/$prog || exit 3
daemon --user=acs-search "$executable $JAVAOPTS -jar $prog.jar >/dev/null 2>&1 &"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop() {
[ "$EUID" != "0" ] && exit 4
echo -n $"Shutting down $prog: "
pkill -9 -f $prog
#killproc $prog -9
RETVAL=$?
echo "OK"
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart|force-reload)
stop
start
;;
try-restart|condrestart)
if status $prog > /dev/null; then
stop
start
fi
;;
reload)
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
esac