summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2011-01-05 16:04:21 +0000
committerajacoutot <ajacoutot@openbsd.org>2011-01-05 16:04:21 +0000
commitf8e041665a8e61914f3fe8c031c52906accd1be5 (patch)
tree90d43350359ca1071d7cf1476a8528192251ae35
parentcut vnd over to using bufq's again. (diff)
downloadwireguard-openbsd-f8e041665a8e61914f3fe8c031c52906accd1be5.tar.xz
wireguard-openbsd-f8e041665a8e61914f3fe8c031c52906accd1be5.zip
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@
-rw-r--r--etc/rc.d/rc.subr7
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"