diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2011-01-05 16:04:22 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2011-01-05 16:04:22 +0000 |
commit | 4d02b357ad53039e64a8e491ef5df9f0fc1d8a46 (patch) | |
tree | c062f65b4c82a98dcdcdbe654e0527e3c3b8c915 /etc/rc.d | |
parent | 86af40393ac137ecb118951c8d09f45cc6b3339b (diff) |
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@
Diffstat (limited to 'etc/rc.d')
-rw-r--r-- | etc/rc.d/rc.subr | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index ddd29fb628f..bd47d97e469 100644 --- a/etc/rc.d/rc.subr +++ b/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" |