freebsd-ports/audio/murmur/files/murmur.in
Mark Felder a1a94d4e71 MFH: r515199
audio/murmur: Fix for clean installs

Config file in 1.3.0 does not specify logfile location and attempts to
write murmur.log to $PWD. Specify path for log and pidfile by patching
sample config file.

Also support reloading service via SIGUSR1 so TLS cert/key updates can
be deployed without restarting server.

Approved by:	portmgr (implicit)
2019-10-22 15:12:04 +00:00

44 lines
864 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: murmur
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# murmur_enable (bool): Set to NO by default.
# Set it to YES to enable murmur.
# murmur_flags (str): Set to "" by default.
# Extra flags passed to start command.
#
. /etc/rc.subr
name=murmur
rcvar=murmur_enable
load_rc_config $name
# Set some defaults
: ${murmur_enable:=NO}
: ${murmur_user=%%USERS%%}
command="%%PREFIX%%/sbin/murmurd"
command_args="-ini %%PREFIX%%/etc/murmur.ini"
pidfile=/var/run/murmur/murmur.pid
start_precmd=murmur_prestart
extra_commands="reload"
sig_reload="USR1"
murmur_prestart() {
for i in /var/log/murmur /var/run/murmur /var/db/murmur; do
if [ ! -d ${i} ]; then
install -d -o %%USERS%% -g %%GROUPS%% ${i}
fi
done
}
run_rc_command "$1"