aboutsummaryrefslogtreecommitdiffstats
path: root/testing/vault/vault.initd
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2015-10-14 21:39:52 +0200
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2015-10-16 14:51:30 +0200
commit597512712019dd11f5e5ede86e404fc7950d84c6 (patch)
tree62cf8fbec27eef16e6aa8e918f2910a11db4336d /testing/vault/vault.initd
parent20f07fd98ac82b5d97a28019d4b29d8a902854bc (diff)
downloadaports-597512712019dd11f5e5ede86e404fc7950d84c6.tar.gz
aports-597512712019dd11f5e5ede86e404fc7950d84c6.tar.bz2
aports-597512712019dd11f5e5ede86e404fc7950d84c6.tar.xz
testing/vault: simplify init script
Diffstat (limited to 'testing/vault/vault.initd')
-rw-r--r--testing/vault/vault.initd37
1 files changed, 11 insertions, 26 deletions
diff --git a/testing/vault/vault.initd b/testing/vault/vault.initd
index f539db7032..b334546df9 100644
--- a/testing/vault/vault.initd
+++ b/testing/vault/vault.initd
@@ -1,33 +1,18 @@
#!/sbin/openrc-run
-name=vault
-daemon=/usr/sbin/$name
-daemon_user=$name
-daemon_group=$name
-pidfile="/run/${name}.pid"
+VAULT_LOG_FILE="/var/log/${SVCNAME}.log"
-depend() {
- need net
- after firewall
-}
-
-start() {
+command=/usr/sbin/${SVCNAME}
+command_args="${vault_opts}"
+command_background="true"
+start_stop_daemon_args="--user ${SVCNAME}:${SVCNAME} --stdout $VAULT_LOG_FILE --stderr $VAULT_LOG_FILE"
+pidfile="/run/${SVCNAME}.pid"
- checkpath -f -m 0644 -o "${daemon_user}":"${daemon_group}" "$pidfile"
-
- ebegin "Starting ${name}"
- start-stop-daemon --start --quiet \
- -m --pidfile "$pidfile" \
- --user ${daemon_user} --group ${daemon_group} \
- -b -1 /dev/null -2 /dev/null \
- -k 027 --exec ${daemon} -- ${vault_opts}
- eend $?
+start_pre() {
+ checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$VAULT_LOG_FILE"
}
-stop() {
- ebegin "Stopping ${name}"
- start-stop-daemon --stop --quiet \
- --pidfile "$pidfile" \
- --exec ${daemon}
- eend $?
+depend() {
+ need net
+ after firewall
}