Browse Source

Prepend an underscore to internal variable names; this was reverted by

mistake in the previous commit.
No functionnal change.
ok robert@
OPENBSD_5_1
ajacoutot 13 years ago
parent
commit
58e9cbce78
1 changed files with 12 additions and 10 deletions
  1. +12
    -10
      src/etc/rc.d/rc.subr

+ 12
- 10
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.49 2011/09/25 17:55:14 halex Exp $
# $OpenBSD: rc.subr,v 1.50 2011/10/07 07:17:25 ajacoutot Exp $
# #
# Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org> # Copyright (c) 2010, 2011 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> # Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@ -45,7 +45,7 @@ rc_stop() {
} }
rc_do() { rc_do() {
if [ -n "${RC_DEBUG}" ]; then
if [ -n "${_RC_DEBUG}" ]; then
echo "doing $@" && "$@" echo "doing $@" && "$@"
else else
"$@" >/dev/null 2>&1 "$@" >/dev/null 2>&1
@ -83,13 +83,13 @@ rc_cmd() {
[ $(id -u) -eq 0 ] || \ [ $(id -u) -eq 0 ] || \
rc_err "$0: need root privileges" rc_err "$0: need root privileges"
[ -z "${RC_FORCE}" ] && [ X"${daemon_flags}" = X"NO" ] && exit 1
[ -z "${_RC_FORCE}" ] && [ X"${daemon_flags}" = X"NO" ] && exit 1
eval _enotsup=\${rc_${1}} eval _enotsup=\${rc_${1}}
[ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported" [ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported"
[ X"${rc_bg}" = X"YES" ] && local _bg="&" [ X"${rc_bg}" = X"YES" ] && local _bg="&"
[ -n "${RC_DEBUG}" ] || local _n="-n"
[ -n "${_RC_DEBUG}" ] || local _n="-n"
case "$1" in case "$1" in
check) check)
@ -102,6 +102,8 @@ rc_cmd() {
if type rc_pre >/dev/null; then if type rc_pre >/dev/null; then
rc_do rc_pre || break rc_do rc_pre || break
fi fi
# XXX only checks the status of the return code,
# and _not_ that the daemon is actually running
rc_do rc_start || break rc_do rc_start || break
if [ -n "${_bg}" ]; then if [ -n "${_bg}" ]; then
sleep 1 sleep 1
@ -131,8 +133,8 @@ rc_cmd() {
rc_exit ok rc_exit ok
;; ;;
restart) restart)
/etc/rc.d/${_name} ${RC_DEBUG} ${RC_FORCE} stop &&
/etc/rc.d/${_name} ${RC_DEBUG} ${RC_FORCE} start
/etc/rc.d/${_name} ${_RC_DEBUG} ${_RC_FORCE} stop &&
/etc/rc.d/${_name} ${_RC_DEBUG} ${_RC_FORCE} start
;; ;;
*) *)
rc_usage rc_usage
@ -144,11 +146,11 @@ rc_cmd() {
[ -n "${daemon}" ] || rc_err "$0: daemon is not set" [ -n "${daemon}" ] || rc_err "$0: daemon is not set"
unset RC_DEBUG RC_FORCE
unset _RC_DEBUG _RC_FORCE
while getopts "df" c; do while getopts "df" c; do
case "$c" in case "$c" in
d) RC_DEBUG=-d;;
f) RC_FORCE=-f;;
d) _RC_DEBUG=-d;;
f) _RC_FORCE=-f;;
*) rc_usage;; *) rc_usage;;
esac esac
done done
@ -164,7 +166,7 @@ getcap -f /etc/login.conf ${_name} 1>/dev/null 2>&1 && \
[ -z "${daemon_class}" ] && daemon_class=daemon [ -z "${daemon_class}" ] && daemon_class=daemon
[ -z "${daemon_user}" ] && daemon_user=root [ -z "${daemon_user}" ] && daemon_user=root
[ -n "${RC_FORCE}" ] && [ X"${_rcflags}" = X"NO" ] && unset _rcflags
[ -n "${_RC_FORCE}" ] && [ X"${_rcflags}" = X"NO" ] && unset _rcflags
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags} [ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
[ -n "${_rcuser}" ] && daemon_user=${_rcuser} [ -n "${_rcuser}" ] && daemon_user=${_rcuser}


Loading…
Cancel
Save