freebsd-ports/audio/jack/files/jackd.in
Thomas Zander a1df13d85f Fix startup script for FreeBSD 10: -o option is unknown
PR:		228266
Submitted by:	takefu@airport.fm
MFH:		2018Q2
2018-06-10 17:11:05 +00:00

37 lines
845 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: jackd
# REQUIRE: LOGIN
#
# Add the following line to /etc/rc.conf to enable jackd:
#
# jackd_enable="YES"
#
: ${jackd_enable="NO"}
: ${jackd_user="root"}
: ${jackd_rtprio="NO"}
: ${jackd_args="-r -doss -r44100 -p1024 -n3 -w16"}
. /etc/rc.subr
name=jackd
rcvar=jackd_enable
procname=%%PREFIX%%/bin/jackd
start_cmd="start_jackd"
start_jackd() {
echo "Starting ${name}."
if [ $jackd_rtprio = "YES" ]; then
local rt="rtprio 1"
fi
# log the date and parameters
echo -e "\n[`date`] Starting the daemon, user=$jackd_user rtprio=$jackd_rtprio args=\"$jackd_args\"" >> /var/log/${name}.log
# daemon(8) should be able to set the realtime priority, but it isn't
$rt daemon -p /var/run/${name}.pid -u "${jackd_user}" %%PREFIX%%/bin/jackd ${jackd_args}
}
load_rc_config ${name}
run_rc_command "$1"