|
|
@ -1,4 +1,4 @@ |
|
|
|
# $OpenBSD: rc.subr,v 1.9 2010/12/10 21:25:50 robert Exp $ |
|
|
|
# $OpenBSD: rc.subr,v 1.10 2010/12/11 09:55:37 robert Exp $ |
|
|
|
|
|
|
|
[ -z "${local_rcconf}" ] && . /etc/rc.conf |
|
|
|
|
|
|
@ -9,8 +9,8 @@ rc_err() { |
|
|
|
|
|
|
|
rc_start() { |
|
|
|
type rc_pre >/dev/null && rc_pre |
|
|
|
su -c ${_rcclass:-daemon} -s ${_rcshell:-/bin/sh} \ |
|
|
|
${_rcuser:-root} -c "${daemon} ${daemon_flags}" >/dev/null |
|
|
|
su -c ${daemon_class:-daemon} -s ${daemon_shell:-/bin/sh} \ |
|
|
|
${daemon_user:-root} -c "${daemon} ${daemon_flags}" >/dev/null |
|
|
|
} |
|
|
|
|
|
|
|
rc_check() { |
|
|
@ -28,6 +28,7 @@ rc_stop() { |
|
|
|
|
|
|
|
rc_cmd() { |
|
|
|
_name=`basename $0` |
|
|
|
|
|
|
|
eval _rcflags=\${${_name}_flags} |
|
|
|
eval _rcuser=\${${_name}_user} |
|
|
|
eval _rcclass=\${${_name}_class} |
|
|
@ -35,9 +36,13 @@ rc_cmd() { |
|
|
|
|
|
|
|
[ `id -u` -eq 0 -o X"$1" = "Xcheck" ] || \ |
|
|
|
rc_err "$0: need root privileges" |
|
|
|
[ -n "${daemon}" ] || rc_err "$0: daemon is not set" |
|
|
|
[ -n "${daemon}" ] || rc_err "$0: daemon is not set" |
|
|
|
[ -n "${_rcflags}" ] && daemon_flags=${_rcflags} |
|
|
|
[ -n "${pexp}" ] || pexp="${daemon}${daemon_flags:+ ${daemon_flags}}" |
|
|
|
[ -n "${_rcuser}" ] && daemon_user=${_rcuser} |
|
|
|
[ -n "${_rcclass}" ] && daemon_class=${_rcclass} |
|
|
|
[ -n "${_rcshell}" ] && daemon_shell=${_rcshell} |
|
|
|
[ -n "${pexp}" ] || \ |
|
|
|
pexp="${daemon}${daemon_flags:+ ${daemon_flags}}" |
|
|
|
|
|
|
|
case "$1" in |
|
|
|
check) |
|
|
|