From 80834b989f8e755e0b7761c924acca3fc571e985 Mon Sep 17 00:00:00 2001 From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Sun, 28 Jan 2018 21:22:06 +0100 Subject: [PATCH] Update FreeBSD RC script - removed /usr/sbin/daemon's option "-t" (first appeared in FreeBSD 11, leading to an error in previous versions; since the [t]itle defaults to the daemonized invocation anyways, this shouldn't make a difference for FreeBSD 11+) - removed /usr/sbin/daemon's option "-u" and the respective variable in the script (ympd has to be started as root to be able to bind to port 80) - allow for additional arguments via ympd_flags="" in rc.conf (which would again allow to drop privileges after binding to the port) --- contrib/ympd.freebsd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/ympd.freebsd b/contrib/ympd.freebsd index 4dcbedd..532a90c 100755 --- a/contrib/ympd.freebsd +++ b/contrib/ympd.freebsd @@ -12,18 +12,17 @@ name="ympd" rcvar="${name}_enable" -command="/usr/local/bin/ympd" +command="/usr/local/bin/${name}" pidfile="/var/run/${name}.pid" start_cmd="ympd_start" -load_rc_config "$name" +load_rc_config "${name}" : ${ympd_enable:="NO"} -: ${ympd_user:="nobody"} ympd_start() { check_startmsgs && echo "Starting ${name}." - /usr/sbin/daemon -f -p "${pidfile}" -t "${name}" -u "${ympd_user}" "${command}" + /usr/sbin/daemon -f -p "${pidfile}" "${command}" "${rc_flags}" } run_rc_command "$1"