History log of /freebsd-10.0-release/etc/rc.shutdown
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 250804 19-May-2013 jamie

Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't
apply to most jails but do apply to vnet jails. This includes adding
a new sysctl "security.jail.vnet" to identify vnet jails.

PR: conf/149050
Submitted by: mdodd
MFC after: 3 days


# 232976 14-Mar-2012 ed

Hide stty(1) errors.

If rc(8) is executed without using a TTY, this error appears at the
beginning:

stty: stdin isn't a terminal

Because this is to be expected and of course not harmful, it is better
to simply hide the error message.

MFC after: 1 week


# 187685 25-Jan-2009 bz

Instead of killing the 'watchdog' subshell and leaving a sleep for
rcshutdown_timeout (normally 30s) around re-parented to init, make
sure both go away using pkill -P.

While noone normally notices this for the system shutdown, it helps for
cleanly shutting down trusted jails.
Found without a killall in the base system, which in rc.d/jail normally
ensures that all processes of a jail to be stopped will be killed.

Reviewed by: silence on current@
MFC after: 4 weeks


# 153027 02-Dec-2005 dougb

Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice,
first to get all the disks mounted (through mountcritremote),
then again to include the local_startup directories.

This dramatically changes the behavior of rc.d/localpkg, as
all "local" scripts that have the new rc.d semantics are now
run in the base rcorder, so only scripts that have not been
converted yet will run in rc.d/localpkg.

Make a similar change in rc.shutdown, and add some functions in
rc.subr to support these changes.

Bump __FreeBSD_version to reflect this change.


# 138847 14-Dec-2004 rse

Improve the RC framework for the clean booting/shutdown of Jails:

1. Feature: for flexibility reasons and as a prerequisite to clean
shutdowns, allow the configuration of a stop/shutdown command
via rc.conf variable "jail_<name>_exec_stop" in addition to the
start/boot command (rc.conf variable "jail_<name>_exec_start"). For
backward compatibility reasons, rc.conf variable "jail_<name>_exec"
is still supported, too.

2. Debug: Add the used boot/shutdown commands to the debug output of
the /etc/rc.d/jail script, too.

3. Security: Run the Jail start/boot command in a cleaned environment
to not leak information from the host to the Jail during startup.

4. Feature: Run the Jail stop/shutdown command "jail_<name>_exec_stop" on
"/etc/rc.d/jail stop <name>" to allow a graceful shutdown of the Jail
before its processes are just killed.

5. Bugfix: When killing the remaining Jail processes give the processes
time to actually perform their termination sequence. Without this the
subsequent umount(8) operations usually fail because the resources
are still in use. Additionally, if after trying to TERM-inate the
processes there are still processes hanging around, finally just KILL
them.

6. Bugfix: In rc.shutdown, if running inside a Jail, skip the /etc/rc.d/*
scripts which are flagged with the KEYWORD "nojail" to allow the
correct operation of rc.shutdown under jail_<name>_exec_stop="/bin/sh
/etc/rc.shutdown". This is analogous to what /etc/rc does inside a Jail.

Now the following typical host-configuration for two Jails works as
expected and correctly boots and shutdowns the Jails:

-----------------------------------------------------------
# /etc/rc.conf:
jail_enable="YES"
jail_list="foo bar"
jail_foo_rootdir="/j/foo"
jail_foo_hostname="foo.example.com"
jail_foo_ip="192.168.0.1"
jail_foo_devfs_enable="YES"
jail_foo_mount_enable="YES"
jail_foo_exec_start="/bin/sh /etc/rc"
jail_foo_exec_stop="/bin/sh /etc/rc.shutdown"
jail_bar_rootdir="/j/bar"
jail_bar_hostname="bar.example.com"
jail_bar_ip="192.168.0.2"
jail_bar_devfs_enable="YES"
jail_bar_mount_enable="YES"
jail_bar_exec_start="/path/to/kjailer -v"
jail_bar_exec_stop="/bin/sh -c 'killall kjailer && sleep 60'"
-----------------------------------------------------------
# /etc/fstab.foo
/v/foo /j/foo/v/foo nullfs rw 0 0
-----------------------------------------------------------
# /etc/fstab.bar
/v/bar /j/bar/v/bar nullfs rw 0 0
-----------------------------------------------------------

Reviewed by: freebsd-hackers
MFC after: 2 weeks


# 136615 17-Oct-2004 schweikh

Fix a bogus variable assignment. You can't expect
_msg="a" \
" b"
to concat the strings. Use
_msg="a"
_msg="$_msg b"
instead (intent is to not exceed 80 chars per line).

MFC after: 1 week


# 136224 07-Oct-2004 mtm

Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days


# 131135 26-Jun-2004 mtm

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.


# 130151 06-Jun-2004 schweikh

Removed whitespace at BOF, EOL & EOF.


# 117324 08-Jul-2003 mtm

Remove last vestiges of the old rc.


# 103655 19-Sep-2002 gordon

Quiet warnings on shutdown.


# 98189 13-Jun-2002 gordon

Add the final bits that allow the use of rc.d. Note that you can toggle
between rc.d and the classic boot scripts based on the rcng variable in
your rc.conf. Defaults to classic boot scripts.

Submitted by: Mike Makonnen


# 96830 17-May-2002 gordon

Fix the order of shutdown scripts so it not only reverses the order of the
files in each ${local_startup} directory, it also reverses the order of the
directories.

Suggested by: jhb
Reviewed by: jake
Approved by: dougb
MFC after: 1 week


# 87728 12-Dec-2001 roam

Set the script_name_sep variable to a safe value if it is not
already set (e.g. a failed/skipped mergemaster run during an upgrade).
Without this, if script_name_sep was not set in the rc.conf files,
local scripts will not be executed on startup or shutdown.

PR: misc/32687
Submitted by: Nicholas Paufler <echofox@discordia.ca> (the problem)
Sheldon Hearn (the idea behind the fix)
Reviewed by: sheldonh
MFC after: 1 week


# 86863 24-Nov-2001 ru

(Forced commit to list actual problems fixed / PRs affected).

Overview of problems fixed:

- fix support for saving and restoring filter/NAT state information
(across reboots for example);

- ipmon(8) is started before loading any filter/NAT rules;

- ipmon(8) and ipfs(8) do not solely depend on ipfilter_enable anymore,
they now also work when only ipnat_enable is true;

- the multiple occurrences of code loading the ipfilter kernel module
have been removed;

- the options have been removed from the _program variables in
defaults/rc.conf and the comments in that file have been updated to
reflect (possibly new) reality;

- the rc.conf.5 manual page has been updated to reflect the changes.

Submitted by: Arjan de Vet <devet@devet.org>
PR: conf/25223, kern/25344, conf/25809,
conf/26275, bin/27016, conf/31482


# 86856 24-Nov-2001 darrenr

second part of the patches to complete ipf changes to rc

PR: multiple
Submitted by: Arjan de Vet <devet@devet.org>


# 85219 20-Oct-2001 darrenr

Put in place for using ipfs use on shutdown and startup.

PR: 27070


# 79825 17-Jul-2001 roam

Add a script_name_sep rc.conf knob to specify the IFS character
for separating the startup scripts' list into individual filenames.

Run the shutdown scripts in reverse alphabetical order, so dependent
services are stopped before the services they depend upon.

Reviewed by: -arch, -audit
MFC after: 3 weeks


# 70108 17-Dec-2000 dougb

Apply a more consistent style to the echo statements in /etc/ scripts.
* Put quotes around each line
* Single quotes for lines with no variable interpolation
* Double quotes if there is
* Capitalize each word that begins a line
* Make echo -n 'Doing foo:' ... echo '.' more of a standard

No functionality changes


# 67397 20-Oct-2000 ache

Back out increasing entropy file size workaround and wait for real fix instead.

Requested by: markm


# 67381 20-Oct-2000 ache

Increase entropy file size from 4096 to 16384 because 4096 actually is not
enough to cause reseeding


# 67179 16-Oct-2000 jwd

Having played with this commit request for a few hours, I've
convinced myself that it's better then what we have, but still
not perfect.

/etc/rc : Attempt to seed /dev/random with multiple backoffs.

/etc/rc.shutdown : Attempt to write the entropy_file.

In debugging the above changes, I've run into some
inconsistancies... rc.shutdown is run via 'init 6', but
does not appear to be run via '/sbin/reboot'. Thus, this
set of changes improves life depending on the mechanism
used to shut the system down.

Submitted by: Doug Barton <DougB@gorean.org>
Approved by: markm


# 66830 08-Oct-2000 obrien

Add copyright notices. Other systems have been barrowing our /etc files
w/o giving any credit.


# 64821 18-Aug-2000 sheldonh

Remove an unwanted space from the "Shutting down daemon processes"
message.

PR: 20692
Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>


# 63802 24-Jul-2000 sheldonh

Previous commit was...

Reviewed by: markm


# 63801 24-Jul-2000 sheldonh

Close a window of readability when creating the entropy seed file,
which must not be world-readable.


# 63689 20-Jul-2000 ache

dd is too verbose writting entropy, redirect its output to /dev/null
Add period at the end of sentence


# 63311 17-Jul-2000 sheldonh

Improve on previous commit:

Don't inhibit the trailing newline for entropy-related messages.
Try harder to save the seed file on shutdown.

Reviewed by: markm


# 63307 17-Jul-2000 markm

Add entropy caching. With this, some entropy is cached at shutdown
time, and this is used to reseed the random number generator at
boot time.

NOTE - this has no hope of working if you halt(); you need to
execute rc.shutdown to get the entropy stash.


# 62640 05-Jul-2000 tg

Now that the scripts in our ports support this, call the scripts
in ${local_startup} with the `stop' option on shutdown.


# 53550 22-Nov-1999 dillon

Finish up umntall support. init now passed an argument to the
rundown script 'reboot' or 'single'. ISO support (which never
worked) has been removed from mount_nfs. mount_nfs and umount
now use mounttab, which allows umntall to work properly. The
rc scripts now call umntall as appropriate.

Submitted by: Martin Blapp <mb@imp.ch>


# 51231 13-Sep-1999 sheldonh

Apply a consistent style to most of the etc scripts. Particularly, use
case instead of test where appropriate, since case allows case is a sh
builtin and (as a side-effect) allows case-insensitivity.

Changes discussed on freebsd-hackers.

Submitted by: Doug Barton <Doug@gorean.org>


# 50472 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 27837 01-Aug-1997 davidn

Add /etc/rc.shutdown capability to init.
Add sample /etc/rc.shutdown (which is just a shell for now).
Submitted by: Ollivier Robert <roberto@keltia.freenix.fr>