summaryrefslogtreecommitdiffstats
path: root/etc/rc.shutdown
Commit message (Collapse)AuthorAgeFilesLines
* Instead of killing the 'watchdog' subshell and leaving a sleep forbz2009-01-251-1/+1
| | | | | | | | | | | | | 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
* Introduce startup scripts from the local_startup directories todougb2005-12-021-1/+7
| | | | | | | | | | | | | | | | 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.
* Improve the RC framework for the clean booting/shutdown of Jails:rse2004-12-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a bogus variable assignment. You can't expectschweikh2004-10-171-2/+2
| | | | | | | | | | | _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
* Remove the requirement for the FreeBSD keyword as it no longermtm2004-10-071-3/+1
| | | | | | | makes any sense. Discussed with: dougb, brooks MFC after: 3 days
* Make the stop command respect the 'fast' prefix.mtm2004-06-261-2/+2
| | | | | | | | 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.
* Removed whitespace at BOF, EOL & EOF.schweikh2004-06-061-1/+1
|
* Remove last vestiges of the old rc.mtm2003-07-081-138/+33
|
* Quiet warnings on shutdown.gordon2002-09-191-1/+1
|
* Add the final bits that allow the use of rc.d. Note that you can togglegordon2002-06-131-0/+51
| | | | | | | 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
* Fix the order of shutdown scripts so it not only reverses the order of thegordon2002-05-181-2/+14
| | | | | | | | | | 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
* Set the script_name_sep variable to a safe value if it is notroam2001-12-121-0/+3
| | | | | | | | | | | | 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
* second part of the patches to complete ipf changes to rcdarrenr2001-11-241-7/+7
| | | | | PR: multiple Submitted by: Arjan de Vet <devet@devet.org>
* Put in place for using ipfs use on shutdown and startup.darrenr2001-10-201-0/+11
| | | | PR: 27070
* Add a script_name_sep rc.conf knob to specify the IFS characterroam2001-07-171-5/+12
| | | | | | | | | | 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
* Apply a more consistent style to the echo statements in /etc/ scripts.dougb2000-12-171-4/+5
| | | | | | | | | | * 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
* Back out increasing entropy file size workaround and wait for real fix instead.ache2000-10-201-1/+1
| | | | Requested by: markm
* Increase entropy file size from 4096 to 16384 because 4096 actually is notache2000-10-201-1/+1
| | | | enough to cause reseeding
* Having played with this commit request for a few hours, I'vejwd2000-10-161-2/+18
| | | | | | | | | | | | | | | | | | 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
* Add copyright notices. Other systems have been barrowing our /etc filesobrien2000-10-081-0/+26
| | | | w/o giving any credit.
* Remove an unwanted space from the "Shutting down daemon processes"sheldonh2000-08-181-1/+1
| | | | | | | message. PR: 20692 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* Close a window of readability when creating the entropy seed file,sheldonh2000-07-241-1/+3
| | | | which must not be world-readable.
* dd is too verbose writting entropy, redirect its output to /dev/nullache2000-07-201-2/+3
| | | | Add period at the end of sentence
* Improve on previous commit:sheldonh2000-07-171-6/+5
| | | | | | | Don't inhibit the trailing newline for entropy-related messages. Try harder to save the seed file on shutdown. Reviewed by: markm
* Add entropy caching. With this, some entropy is cached at shutdownmarkm2000-07-171-0/+15
| | | | | | | | 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.
* Now that the scripts in our ports support this, call the scriptstg2000-07-051-1/+29
| | | | in ${local_startup} with the `stop' option on shutdown.
* Finish up umntall support. init now passed an argument to thedillon1999-11-221-0/+9
| | | | | | | | | 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>
* Apply a consistent style to most of the etc scripts. Particularly, usesheldonh1999-09-131-4/+4
| | | | | | | | | 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>
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Add /etc/rc.shutdown capability to init.davidn1997-08-021-0/+26
Add sample /etc/rc.shutdown (which is just a shell for now). Submitted by: Ollivier Robert <roberto@keltia.freenix.fr>
OpenPOWER on IntegriCloud