-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcertmanager.Debian-7
More file actions
executable file
·72 lines (57 loc) · 1.52 KB
/
certmanager.Debian-7
File metadata and controls
executable file
·72 lines (57 loc) · 1.52 KB
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
#! /bin/bash --posix
### BEGIN INIT INFO
# Provides: certmanager
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Certmanager X.509 Web certificate generation service
### END INIT INFO
# /etc/init.d/certmanager: start and stop the certificate manager service
. /lib/lsb/init-functions
umask 022
DAEMON='/usr/local/bin/certmanager'
LOOP_PIDFILE='/var/run/certmanager.loop.pid'
PIDFILE='/var/run/certmanager.pid'
USERNAME='certmanager'
[ -f /etc/default/certmanager ] && . /etc/default/certmanager
test -x "$DAEMON" || exit 0
export PATH="${PATH:+$PATH:}/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin"
do_start ()
{
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" --chuid "$USERNAME" --make-pidfile
}
start_loop ()
{
echo "$BASHPID" > "$LOOP_PIDFILE"
while true; do
do_start
rm -f "$PIDFILE"
sleep 1
done
}
case "$1" in
start)
log_daemon_msg "Starting certmanager daemon" "certmanager" || true
(start_loop < /dev/null &> /dev/null &)
;;
stop)
log_daemon_msg "Stopping certmanager daemon" "certmanager" || true
[ -s "$LOOP_PIDFILE" ] && kill -KILL $(cat "$LOOP_PIDFILE")
[ -s "$PIDFILE" ] && kill -TERM $(cat "$PIDFILE")
rm -f "$LOOP_PIDFILE" "$PIDFILE"
;;
reload|force-reload)
$0 stop
$0 start
;;
restart)
$0 stop
$0 start
;;
*)
log_action_msg "Usage: /etc/init.d/certmanager {start|stop|reload|force-reload|restart}" || true
exit 1
esac
exit 0