diff options
Diffstat (limited to 'user/mumble/murmur.initd')
-rw-r--r-- | user/mumble/murmur.initd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/user/mumble/murmur.initd b/user/mumble/murmur.initd new file mode 100644 index 000000000..dfbc46821 --- /dev/null +++ b/user/mumble/murmur.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +description="Mumble VoIP server" +command="/usr/bin/murmurd" +: "${config:=/etc/murmur.ini}" +: "${command_args:=-ini $config}" + +extra_started_commands="reload" +description_reload="Reload TLS settings" + +# As of 1.3.2 murmur will make the PID file *after* it switches to the +# unprivileged user, which is bad. So make start-stop-daemon handle the +# PID file and user switching instead. +command_background=true +command_args="$command_args -fg" + +command_user="$(awk -F= '$1 == "uname" { print $2 }' "$config")" +: "${command_user:=murmur}" + +pidfile="$(awk -F= '$1 == "pidfile" { print $2 }' "$config")" +: "${pidfile:=/var/run/$RC_SVCNAME.pid}" + +# Ignores logfile when -fg is used. +logfile="$(awk -F= '$1 == "logfile" { print $2 }' "$config")" +: "${logfile:=/var/log/murmur.log}" +start_stop_daemon_args="--stdout $logfile --stderr $logfile" + +start_pre() { + checkpath -m 0640 -f -o "$command_user" "$logfile" +} + +reload() { + ebegin "Reloading $RC_SVCNAME TLS settings" + start-stop-daemon --signal USR1 --pidfile "$pidfile" + eend $? +} |