-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.redhat
executable file
·64 lines (54 loc) · 952 Bytes
/
init.redhat
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
#!/bin/bash
#
#
# chkconfig: 2345 99 01
# description: init script
# Source function library.
. /etc/init.d/functions
target=`readlink -f $0`
bin_dir=`dirname $target`
launcher=$bin_dir/launcher
install_path=`readlink -f $bin_dir/..`
name=`basename $install_path`
# Run-as user
user=platform
start() {
echo -n "Starting: ${name} "
daemon --user=${user} ${launcher} start
RETVAL=$?
echo
return $RETVAL
}
stop() {
echo -n $"Stopping: ${name} "
daemon --user=${user} ${launcher} stop
RETVAL=$?
echo
return $RETVAL
}
status () {
daemon --user=${user} ${launcher} status
RETVAL=$?
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac