summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-06-26 09:27:30 +0000
committermtm <mtm@FreeBSD.org>2004-06-26 09:27:30 +0000
commit5e58125da8781c14ae12a6422046f6102ba4ee3d (patch)
tree27f947915fbf71e9de3804d14a50068115c8f7cc /etc
parent0567d4ef5fa68876b3d70414d79e61c5cad5db3e (diff)
downloadFreeBSD-src-5e58125da8781c14ae12a6422046f6102ba4ee3d.zip
FreeBSD-src-5e58125da8781c14ae12a6422046f6102ba4ee3d.tar.gz
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.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.shutdown4
-rw-r--r--etc/rc.subr7
2 files changed, 6 insertions, 5 deletions
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index 5555f7d..fa00feb 100644
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -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)
diff --git a/etc/rc.subr b/etc/rc.subr
index 2d879e6..349daee 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -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)."
OpenPOWER on IntegriCloud