Browse Source

After the recent changes, there is no need for an rc_conf function.

As schwarze@ also stated, this will prevent anyone from calling it
(which would be an error) and makes it clearer that rc.subr is not just
a functions container.
No functionnal change, unless you were calling rc_conf from an rc script
which would have been wrong anyway.
ok schwarze@ robert@
OPENBSD_4_9
ajacoutot 14 years ago
parent
commit
be1812f231
1 changed files with 22 additions and 25 deletions
  1. +22
    -25
      src/etc/rc.d/rc.subr

+ 22
- 25
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.16 2010/12/27 14:49:05 ajacoutot Exp $
# $OpenBSD: rc.subr,v 1.17 2010/12/29 15:28:01 ajacoutot Exp $
rc_err() { rc_err() {
echo $1 echo $1
@ -24,29 +24,6 @@ rc_stop() {
type rc_post >/dev/null && rc_post || return 0 type rc_post >/dev/null && rc_post || return 0
} }
rc_conf() {
[ -n "${daemon}" ] || rc_err "$0: daemon is not set"
_name=`basename $0`
eval _rcflags=\${${_name}_flags}
eval _rcuser=\${${_name}_user}
eval _rcclass=\${${_name}_class}
eval _rcshell=\${${_name}_shell}
[ -z "${daemon_class}" ] && daemon_class=daemon
[ -z "${daemon_shell}" ] && daemon_shell=/bin/sh
[ -z "${daemon_user}" ] && daemon_user=root
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
[ -n "${_rcuser}" ] && daemon_user=${_rcuser}
[ -n "${_rcclass}" ] && daemon_class=${_rcclass}
[ -n "${_rcshell}" ] && daemon_shell=${_rcshell}
daemon_flags=`echo ${daemon_flags} | tr -s "[:space:]"`
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
}
rc_cmd() { rc_cmd() {
[ `id -u` -eq 0 -o X"$1" = "Xcheck" ] || \ [ `id -u` -eq 0 -o X"$1" = "Xcheck" ] || \
rc_err "$0: need root privileges" rc_err "$0: need root privileges"
@ -80,4 +57,24 @@ rc_cmd() {
} }
[ -z "${local_rcconf}" ] && . /etc/rc.conf [ -z "${local_rcconf}" ] && . /etc/rc.conf
rc_conf
[ -n "${daemon}" ] || rc_err "$0: daemon is not set"
_name=`basename $0`
eval _rcflags=\${${_name}_flags}
eval _rcuser=\${${_name}_user}
eval _rcclass=\${${_name}_class}
eval _rcshell=\${${_name}_shell}
[ -z "${daemon_class}" ] && daemon_class=daemon
[ -z "${daemon_shell}" ] && daemon_shell=/bin/sh
[ -z "${daemon_user}" ] && daemon_user=root
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags}
[ -n "${_rcuser}" ] && daemon_user=${_rcuser}
[ -n "${_rcclass}" ] && daemon_class=${_rcclass}
[ -n "${_rcshell}" ] && daemon_shell=${_rcshell}
daemon_flags=`echo ${daemon_flags} | tr -s "[:space:]"`
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"

Loading…
Cancel
Save