forked from fusioninventory/fusioninventory-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fusioninventory-agent.init.redhat
executable file
·71 lines (64 loc) · 1.49 KB
/
fusioninventory-agent.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
64
65
66
67
68
69
70
#!/bin/sh
#
# chkconfig: - 88 12
# description: FusionInventory Agent
# processname: fusioninventory-agent
# config: /etc/sysconfig/fusioninventory-agent.pid
# pidfile: /var/run/fusioninventory-agent.pid
### BEGIN INIT INFO
# Provides: fusioninventory-agent
# Required-Start: $remote_fs $network $named $syslog
# Required-Stop: $remote_fs $network $named $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Short-Description: FusionInventory agent
# Description: FusionInventory agent
### END INIT INFO
# source function library
. /etc/rc.d/init.d/functions
desc="FusionInventory Agent"
prog=fusioninventory-agent
lockfile=/var/lock/subsys/$prog
pidfile=/var/run/$prog.pid
if [ -r /etc/sysconfig/fusioninventory-agent ]; then
. /etc/sysconfig/fusioninventory-agent
fi
start() {
echo -n "Starting $prog: "
daemon fusioninventory-agent --daemon $OPTIONS --pidfile $pidfile 2>/dev/null
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
}
stop() {
echo -n "Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart|reload|force-reload)
stop
start
;;
condrestart)
if [ -f $lockfile ]; then
stop
start
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
exit 1
;;
esac