forked from webhat/modbustcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modbustcpd
executable file
·47 lines (37 loc) · 1.07 KB
/
modbustcpd
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
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation, Daniel Crompton
# Distributed under the terms of the GNU General Public License v2
extra_commands="checkconfig"
extra_started_commands="reload"
: ${MODBUSD_PIDFILE:=/var/run/${SVCNAME}.pid}
: ${MODBUSD_BINARY:=/usr/sbin/modbustcp}
depend() {
use logger dns
}
checkconfig() {
return 0
}
start() {
checkconfig || return 1
ebegin "Starting ${SVCNAME}"
start-stop-daemon -b --start --exec "${MODBUSD_BINARY}" \
--pidfile "${MODBUSD_PIDFILE}" \
-- ${MODBUSD_OPTS}
eend $?
}
stop() {
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return 1
fi
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --exec "${MODBUSD_BINARY}" \
--pidfile "${MODBUSD_PIDFILE}" --quiet
eend $?
}
reload() {
checkconfig || return 1
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP \
--exec "${MODBUSD_BINARY}" --pidfile "${MODBUSD_PIDFILE}"
eend $?
}