blob: 57d3343159f585cff468bbffa1be96e63e77fa11 (
plain)
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
|
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
extra_commands="depend checkconfig reload"
depend() {
need net
use logger
after bootmist
}
checkconfig() {
if [ ! -f "$DAEMON" ] ; then
ewarn "Unable to find $DAEMON"
return 1
fi
if [ ! -f "$CONF" ] ; then
ewarn $CONF " does not exist."
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Creating command pipe (${COMMANDPIPE})"
mkfifo -m 660 "${COMMANDPIPE}"
chown ocsigenserver:ocsigenserver "${COMMANDPIPE}"
eend $?
ebegin "Starting ocsigen"
start-stop-daemon --start --exec $DAEMON -- \
--pidfile $PIDFILE \
--daemon \
$OCSIGEN_OPTS
eend $?
}
stop() {
ebegin "Stopping ocsigen"
start-stop-daemon --stop --pidfile $PIDFILE
eend $?
ebegin "Removing command pipe (${COMMANDPIPE})"
rm -f "${COMMANDPIPE}"
eend $?
}
reload() {
if [ ! -f "$PIDFILE" ] ; then
ewarn "$PIDFILE not found!!"
ewarn "Ocsigen is not running. Not reloading."
return 1
fi
ebegin "Reloading ocsigen"
echo reload > /var/run/ocsigen_command
eend $?
}
|