aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.shutdown
Commit message (Collapse)AuthorAgeFilesLines
* Refine the "nojail" rc keyword, adding "nojailvnet" for files that don'tJamie Gritton2013-05-191-1/+6
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=250804
* Hide stty(1) errors.Ed Schouten2012-03-141-1/+1
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=232976
* Instead of killing the 'watchdog' subshell and leaving a sleep forBjoern A. Zeeb2009-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 Notes: svn path=/head/; revision=187685
* Introduce startup scripts from the local_startup directories toDoug Barton2005-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. Notes: svn path=/head/; revision=153027
* Improve the RC framework for the clean booting/shutdown of Jails:Ralf S. Engelschall2004-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 Notes: svn path=/head/; revision=138847
* Fix a bogus variable assignment. You can't expectJens Schweikhardt2004-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 Notes: svn path=/head/; revision=136615
* Remove the requirement for the FreeBSD keyword as it no longerMike Makonnen2004-10-071-3/+1
| | | | | | | | | | makes any sense. Discussed with: dougb, brooks MFC after: 3 days Notes: svn path=/head/; revision=136224
* Make the stop command respect the 'fast' prefix.Mike Makonnen2004-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. Notes: svn path=/head/; revision=131135
* Removed whitespace at BOF, EOL & EOF.Jens Schweikhardt2004-06-061-1/+1
| | | | Notes: svn path=/head/; revision=130151
* Remove last vestiges of the old rc.Mike Makonnen2003-07-081-138/+33
| | | | Notes: svn path=/head/; revision=117324
* Quiet warnings on shutdown.Gordon Tetlow2002-09-191-1/+1
| | | | Notes: svn path=/head/; revision=103655
* Add the final bits that allow the use of rc.d. Note that you can toggleGordon Tetlow2002-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 Notes: svn path=/head/; revision=98189
* Fix the order of shutdown scripts so it not only reverses the order of theGordon Tetlow2002-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 Notes: svn path=/head/; revision=96830
* Set the script_name_sep variable to a safe value if it is notPeter Pentchev2001-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 Notes: svn path=/head/; revision=87728
* second part of the patches to complete ipf changes to rcDarren Reed2001-11-241-7/+7
| | | | | | | | PR: multiple Submitted by: Arjan de Vet <devet@devet.org> Notes: svn path=/head/; revision=86856
* Put in place for using ipfs use on shutdown and startup.Darren Reed2001-10-201-0/+11
| | | | | | | PR: 27070 Notes: svn path=/head/; revision=85219
* Add a script_name_sep rc.conf knob to specify the IFS characterPeter Pentchev2001-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 Notes: svn path=/head/; revision=79825
* Apply a more consistent style to the echo statements in /etc/ scripts.Doug Barton2000-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 Notes: svn path=/head/; revision=70108
* Back out increasing entropy file size workaround and wait for real fix instead.Andrey A. Chernov2000-10-201-1/+1
| | | | | | | Requested by: markm Notes: svn path=/head/; revision=67397
* Increase entropy file size from 4096 to 16384 because 4096 actually is notAndrey A. Chernov2000-10-201-1/+1
| | | | | | | enough to cause reseeding Notes: svn path=/head/; revision=67381
* Having played with this commit request for a few hours, I'veJohn W. De Boskey2000-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 Notes: svn path=/head/; revision=67179
* Add copyright notices. Other systems have been barrowing our /etc filesDavid E. O'Brien2000-10-081-0/+26
| | | | | | | w/o giving any credit. Notes: svn path=/head/; revision=66830
* Remove an unwanted space from the "Shutting down daemon processes"Sheldon Hearn2000-08-181-1/+1
| | | | | | | | | | message. PR: 20692 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> Notes: svn path=/head/; revision=64821
* Close a window of readability when creating the entropy seed file,Sheldon Hearn2000-07-241-1/+3
| | | | | | | which must not be world-readable. Notes: svn path=/head/; revision=63801
* dd is too verbose writting entropy, redirect its output to /dev/nullAndrey A. Chernov2000-07-201-2/+3
| | | | | | | Add period at the end of sentence Notes: svn path=/head/; revision=63689
* Improve on previous commit:Sheldon Hearn2000-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 Notes: svn path=/head/; revision=63311
* Add entropy caching. With this, some entropy is cached at shutdownMark Murray2000-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. Notes: svn path=/head/; revision=63307
* Now that the scripts in our ports support this, call the scriptsThomas Gellekum2000-07-051-1/+29
| | | | | | | in ${local_startup} with the `stop' option on shutdown. Notes: svn path=/head/; revision=62640
* Finish up umntall support. init now passed an argument to theMatthew Dillon1999-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> Notes: svn path=/head/; revision=53550
* Apply a consistent style to most of the etc scripts. Particularly, useSheldon Hearn1999-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> Notes: svn path=/head/; revision=51231
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50472
* Add /etc/rc.shutdown capability to init.David Nugent1997-08-021-0/+26
Add sample /etc/rc.shutdown (which is just a shell for now). Submitted by: Ollivier Robert <roberto@keltia.freenix.fr> Notes: svn path=/head/; revision=27837