From 00107b2b9e14c835dbdbb6e7e2439d16d9692dd2 Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Wed, 5 Jan 2011 16:04:21 +0000 Subject: [PATCH] Put the "su -c ..." command into an rcexec variable so that we can easily use it in rc scripts instead of copying/pasting the same huge command lines everywhere. ok robert@ sthen@ --- src/etc/rc.d/rc.subr | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index ddd29fb6..bd47d97e 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.18 2011/01/04 16:02:24 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.19 2011/01/05 16:04:21 ajacoutot Exp $ rc_err() { echo $1 @@ -7,8 +7,7 @@ rc_err() { rc_start() { type rc_pre >/dev/null && rc_pre - su -l -c ${daemon_class} -s ${daemon_shell} ${daemon_user} \ - -c "${daemon} ${daemon_flags}" >/dev/null + ${rcexec} "${daemon} ${daemon_flags}" >/dev/null } rc_check() { @@ -77,5 +76,5 @@ getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && \ [ -n "${_rcuser}" ] && daemon_user=${_rcuser} daemon_flags=`echo ${daemon_flags} | tr -s "[:space:]"` - pexp="${daemon}${daemon_flags:+ ${daemon_flags}}" +rcexec="su -l -c ${daemon_class} -s ${daemon_shell} ${daemon_user} -c"