1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

Make the stop command respect the 'fast' prefix.

Most notably, this cleans up messages when shutting down from
single user. In such a case there are usually no daemons running,
but their pid files are still in /var/run. This causes rc.d to
output diagnostics about daemons with pidfiles, but that are
not running.
This commit is contained in:
Mike Makonnen 2004-06-26 09:27:30 +00:00
parent cb9ea5f4cb
commit 3621fa11d7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131135
2 changed files with 6 additions and 5 deletions

View File

@ -85,8 +85,8 @@ fi
files=`eval grep -l \'^# KEYWORD:.*FreeBSD\' \`rcorder -k shutdown /etc/rc.d/* 2>/dev/null\``
for _rc_elem in `reverse_list $files`; do
debug "run_rc_script $_rc_elem stop"
run_rc_script $_rc_elem stop
debug "run_rc_script $_rc_elem faststop"
run_rc_script $_rc_elem faststop
done
# Terminate the background watchdog timer (if it is running)

View File

@ -492,8 +492,8 @@ run_rc_command()
_pidcmd=
_procname=${procname:-${command}}
# setup pid check command if not fast
if [ -z "$rc_fast" -a -n "$_procname" ]; then
# setup pid check command
if [ -n "$_procname" ]; then
if [ -n "$pidfile" ]; then
_pidcmd='rc_pid=$(check_pidfile '"$pidfile $_procname $command_interpreter"')'
else
@ -586,7 +586,7 @@ run_rc_command()
;;
start)
if [ -n "$rc_pid" ]; then
if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
echo "${name} already running? (pid=$rc_pid)."
exit 1
fi
@ -671,6 +671,7 @@ $command $rc_flags $command_args"
stop)
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && exit 0
if [ -n "$pidfile" ]; then
echo \
"${name} not running? (check $pidfile)."