blob: 345ab284e0138f143afcc354ec1e5001bdb69e97 (
plain) (
blame)
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
|
# RPKI CA Service
description "RPKI CA Servers"
author "Rob Austein <sra@hactrn.net>"
# This is almost certainly wrong. Suggestions on how to improve this
# welcome, but please first read the Python code to understand what it
# is doing.
# Our only real dependencies are on mysqld and our config file.
start on started mysql
stop on stopping mysql
pre-start script
if test -f /etc/rpki.conf &&
test -f /usr/share/rpki/ca.cer &&
test -f /usr/share/rpki/irbe.cer &&
test -f /usr/share/rpki/irdbd.cer &&
test -f /usr/share/rpki/rpkid.cer &&
test -f /usr/share/rpki/rpkid.key
then
install -m 755 -o rpkid -g rpkid -d /var/run/rpki /usr/share/rpki/publication
# This should be running as user rpkid, but I haven't got all
# the pesky details worked out yet. Most testing to date has
# either been all under a single non-root user or everything
# as root, so, eg, running "rpkic initialize" as root will not
# leave things in a sane state for rpkid running as user
# rpkid.
#
# In the interest of debugging the rest of this before trying
# to break new ground, run daemons as root for the moment,
# with the intention of coming back to fix this later.
#
#sudo -u rpkid /usr/sbin/rpki-start-servers
/usr/sbin/rpki-start-servers
else
stop
exit 0
fi
end script
post-start exec /usr/sbin/rpki-sql-setup --apply-deferred-upgrades
post-stop script
for i in rpkid pubd irdbd rootd
do
if test -f /var/run/rpki/$i.pid
then
kill `cat /var/run/rpki/$i.pid`
fi
done
end script
|