Browse Source

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@
OPENBSD_4_9
ajacoutot 14 years ago
parent
commit
00107b2b9e
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/etc/rc.d/rc.subr

+ 3
- 4
src/etc/rc.d/rc.subr View File

@ -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() { rc_err() {
echo $1 echo $1
@ -7,8 +7,7 @@ rc_err() {
rc_start() { rc_start() {
type rc_pre >/dev/null && rc_pre 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() { rc_check() {
@ -77,5 +76,5 @@ getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && \
[ -n "${_rcuser}" ] && daemon_user=${_rcuser} [ -n "${_rcuser}" ] && daemon_user=${_rcuser}
daemon_flags=`echo ${daemon_flags} | tr -s "[:space:]"` daemon_flags=`echo ${daemon_flags} | tr -s "[:space:]"`
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}" pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
rcexec="su -l -c ${daemon_class} -s ${daemon_shell} ${daemon_user} -c"

Loading…
Cancel
Save