60 lines
1.2 KiB
Bash
60 lines
1.2 KiB
Bash
#!/sbin/openrc-run
|
|
|
|
command="/usr/local/bin/vault"
|
|
command_user="vault:vault"
|
|
command_background=true
|
|
capabilities="^cap_chown,^cap_ipc_lock"
|
|
pidfile="/var/run/${RC_SVCNAME}.pid"
|
|
|
|
# args
|
|
config_args="-config=/etc/$RC_SVCNAME/config.hcl"
|
|
log_file="-log-file=/var/log/$RC_SVCNAME/vault.log"
|
|
log_format="-log-format=json"
|
|
log_level="-log-level=info"
|
|
log_rotate="-log-rotate-bytes=10000 -log-rotate-max-files=10"
|
|
log_args="$log_file $log_format $log_level $log_rotate"
|
|
command_args="server $config_args $log_args -non-interactive"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath --directory \
|
|
--owner $command_user \
|
|
--mode 0755 \
|
|
/var/log/$RC_SVCNAME
|
|
}
|
|
#
|
|
# start() {
|
|
# ebegin "Starting $RC_SVCNAME"
|
|
# start-stop-daemon --start \
|
|
# --exec $command \
|
|
# --capabilities $capabilities \
|
|
# --make-pidfile \
|
|
# --pidfile /var/run/$RC_SVCNAME.pid \
|
|
# --user $command_user:$command_group \
|
|
#
|
|
# -- \
|
|
# $command_args
|
|
#
|
|
# eend $?
|
|
# }
|
|
#
|
|
# stop() {
|
|
# ebegin "Stopping $RC_SVCNAME"
|
|
# start-stop-daemon --stop \
|
|
# --exec $command \
|
|
# --pidfile /var/run/$RC_SVCNAME.pid
|
|
#
|
|
# eend $?
|
|
# }
|
|
#
|
|
# restart() {
|
|
# ebegin "Restarting $RC_SVCNAME"
|
|
# stop()
|
|
# start()
|
|
# eend $?
|
|
# }
|
|
# vim: set filetype=sh :
|