summaryrefslogtreecommitdiff
path: root/user/mumble/murmur.initd
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com>2020-09-13 20:11:14 -0400
committerMax Rees <maxcrees@me.com>2020-11-28 17:13:28 -0500
commitcc6d3841cc54fb52ccb09f2429a6c81c5ceb9dfd (patch)
tree50a0626a184e6d8ab10df57e25167275125ff07c /user/mumble/murmur.initd
parentb65f9c35d6df7616712ce8bf12a488d8d06bc230 (diff)
downloadpackages-cc6d3841cc54fb52ccb09f2429a6c81c5ceb9dfd.tar.gz
packages-cc6d3841cc54fb52ccb09f2429a6c81c5ceb9dfd.tar.bz2
packages-cc6d3841cc54fb52ccb09f2429a6c81c5ceb9dfd.tar.xz
packages-cc6d3841cc54fb52ccb09f2429a6c81c5ceb9dfd.zip
user/mumble: new package
Diffstat (limited to 'user/mumble/murmur.initd')
-rw-r--r--user/mumble/murmur.initd35
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 $?
+}