When performing "start", "stop" or "reload" in run_rc_command(),

send any "<name> already running" or "<name> not running" messages
to stderr instead of stdout before the (existing) non-zero exit.
This commit is contained in:
lukem 2004-05-03 14:52:26 +00:00
parent fe669e0931
commit 9bd9220cd7

View File

@ -1,4 +1,4 @@
# $NetBSD: rc.subr,v 1.62 2004/04/02 13:13:47 jmmv Exp $
# $NetBSD: rc.subr,v 1.63 2004/05/03 14:52:26 lukem Exp $
#
# Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
# All rights reserved.
@ -504,7 +504,7 @@ run_rc_command()
start)
if [ -n "$rc_pid" ]; then
echo "${name} already running? (pid=$rc_pid)."
echo 1>&2 "${name} already running? (pid=$rc_pid)."
exit 1
fi
@ -582,10 +582,10 @@ $command $rc_flags $command_args"
stop)
if [ -z "$rc_pid" ]; then
if [ -n "$pidfile" ]; then
echo \
echo 1>&2 \
"${name} not running? (check $pidfile)."
else
echo "${name} not running?"
echo 1>&2 "${name} not running?"
fi
exit 1
fi
@ -621,10 +621,10 @@ $command $rc_flags $command_args"
reload)
if [ -z "$rc_pid" ]; then
if [ -n "$pidfile" ]; then
echo \
echo 1>&2 \
"${name} not running? (check $pidfile)."
else
echo "${name} not running?"
echo 1>&2 "${name} not running?"
fi
exit 1
fi