aboutsummaryrefslogtreecommitdiff
path: root/rc.shutdown
AgeCommit message (Collapse)AuthorFiles
2011-08-25shutdown: rely on init being installed by the initrdTom Gundersen1
init is now included in mkinitcpio's busybox, so we don't need to copy it. This might break compat with dracut, but it can be worked around very simply in case anyone wants to use dracut with Arch, so we don't care. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-08-25sutdown: support both poweroff and rebootTom Gundersen1
Tell the /run/initramfs/shutdown what action to preform. Still no kexec support though. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-08-03arch-tmpfiles: avoid subshell in creating empty filesDave Reisner1
install /dev/null as the new file instead of creating an empty file via a no-op process substitution. Signed-off-by: Dave Reisner <dreisner@archlinux.org> [tomegun: the commit also adds a similar fix to rc.shutdown] Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-07-26shutdown: pivot into a shutdown ramfsTom Gundersen1
Assume that a shutdown executable has been created in /run/initramfs by either dracut or mkinitramfs. Setup /run/initramfs to be a new root and pivot into it. Making sure that nothing is using our old root anymore. In particular this means we have to reexec init in the new root and make sure stdio is using the new /dev/console. This is inspired by Harald Hoyers work for systemd as well as Thomas Bächlers deinitramfs. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-07-22rc.shutdown: Move 'run_hook shutdown_start' after "Initiating Shutdown..."Kurt J. Bosch1
Rationale Avoid printing any start hook status messages above the head line.
2011-07-10Refactor kill_everything, fsck_all and mount_all codeKurt J. Bosch1
Genaral scheme for hook positions is now: run_hook pre_foo if [[$WE_WANT_TO_DO_FOO]]]; then stat_busy "Doing foo" if [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]]; then stat_fail else ... stat_done fi fi run hook post_foo rc.sysinit ----------- run_hook pre_foo [[$WE_WANT_TO_DO_FOO]] && status "Doing foo" foo run hook post_foo functions ------------ foo() { [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]] && return 1 ... } Rationale Following this scheme as close as possible (without duplicating code and status messages) makes stuff more readable and uniform. Splitting kill_everything() into two new functions stop_all_daemons() and kill_all() also allows customization of either daemons stopping or process killing in an easy way. Suggested-by: Tom Gundersen <teg@jklm.no>
2011-06-28Move export PATH into functionsKurt J. Bosch1
Also sanitze the PATH for rc.single, rc.multi, rc.local and daemons.
2011-06-28Fix whitespaceKurt J. Bosch1
2011-06-24Get rid of simple if-constucts by using '&&'Kurt J. Bosch1
2011-06-24Some more cosmeticsKurt J. Bosch1
2011-06-24Simplify random seed file creationKurt J. Bosch1
2011-06-24Simplify unmounting filesystemsKurt J. Bosch1
This also keeps all tmpfs allways. Some might be in still in use because of a running splash daemon etc.
2011-06-24Some cosmeticsKurt J. Bosch1
2011-06-24Simplify timezone copyingKurt J. Bosch1
Error/stat_fail when $TIMEZONE is invalid instead of skipping silently.
2011-06-22Allow custom fsck on shutdown via hook (FS#18736)Kurt J. Bosch1
2011-06-19rc.shutdown: continuation of fe48fab2c2c35cDave Reisner1
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-05add PATH, strip absolute path from binariesDave Reisner1
Since we're declaring a PATH anyways, we may as well use it. This gives us immunity against binaries moving around, as in the recent case of iproute2. A few other minor, associated, tweaks to go along with this: * any -x tests are modified to use 'type -P' to resolve the path before checking for execute permission * any pidof checks are stripped of paths as well.
2011-05-08Change stat_busy()/stat_done() -> status()Gerardo Exequiel Pozzi1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-04-30rc.shutdown should recognize LVM upon LUKS optionIan-Xue Li1
This fixes FS#23889. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-04-26fixup: umount tmpfs on shutdownTom Gundersen1
As suggested by seblu: - add comment to explain what we unmount and why, and - use /bin/grep rather than grep Also add some more redirects to /dev/null. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-04-23umount tmpfs on shutdown if devtmpfs is usedGerardo Exequiel Pozzi1
This fixes FS#19783. [tomegun: some adjustments: - always umount ramfs as we never mount /dev as ramfs; and - don't umount /dev/pts as it might still be useful.] Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-04-04workaround: do not unset NIS on shutdownTom Gundersen1
If this bug is still present (after more than 4 years) it should be reported and fixed in syslog-ng. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-04-04workaround: do not rmmod psmouseTom Gundersen1
If this bug is still present (after more than 4 years) it should be reported and fixed in the kernel. Dave points out that this was fixed by kernel commit a1cec06177386 (which is in 2.6.21 and was backported to at least 2.6.19.6). Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-03-30Merge branch 'hwclock-from-kurt' into arch-masterTom Gundersen1
Conflicts: rc.shutdown rc.sysinit
2011-03-30Make hwclock --adjust as well as --systohc optional (FS#13684)Kurt J. Bosch1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-03-29whitespace cleanupDave Reisner1
* adhere to a consistant vim modeline * use top-right/bottom-left braces for functions Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-02-27Improve encrypted filesystem detectionSeblu1
2010-12-06lvm: enable/disable monitoring of lvm2 groupsTom Gundersen1
Monitoring does not work when /var is mounted ro, so only enable monitoring when we know that /var is rw. Thanks to Thomas Bächler for pointing this out.
2010-12-06lvm: run vgchange in sysinit modeTom Gundersen1
This avoids problems with lack of rw filesystems. Solves: #FS18153.
2010-07-23Rewrite /etc/crypttab processing.Victor Lowther1
Split out reading /etc/crypttab and procssing the individual lines into their own helper functions, and bashify the resulting shorter code. Processing this file is still ugly, though. :(
2010-07-11Bashify rc.shutdownVictor Lowther1
Shorten domainname conditional execution. Use parameter expansion instead of dirname. Clean up entropy pool saving and system clock saving. Flatten LVM deactivation if block
2010-07-11Both rc.single and rc.shutdown use the same code to kill everything.Victor Lowther1
Simplify it, and move that shared code into functions. Parsing the output of ls is Bad, especially when globbing works just as well and does not get confused by odd characters in filenames. bash has arithemetic for loops. Use them instead of while loops for iterating over arrays.
2010-06-06Add nodevtmpfs at rc.shutdown when umountGerardo Exequiel Pozzi1
To avoid message about busy filesystem. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-05-03Apply 'encryption: Look for cryptsetup in various places' to rc.shutdown as well2010.05-2Thomas Bächler1
2010-01-24Move shutdown_prekillall hook after the stat_busy message (as per request by ↵2010.01-1Thomas Bächler1
Kurt Bosch)
2009-12-05Check that cryptsetup mapping exists before trying to remove itSolstice d'Hiver1
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
2009-10-05Always shutdown daemons, regardless of runlevelAaron Griffin1
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-26Make the hook-system a bit more usableThomas Bächler1
This patch makes the hook names unique, prefixing them all with the script name (without the 'rc.') It also removes the explicit declarations of all elements of the array, bash assumes "" if they are uninitialized
2009-08-25Implement a hook-system that allows to add custom code to the initscripts at ↵Thomas Bächler1
certain places A function add_hook can be called from functions.d to register a hook function. The existing hooks are based on suggestions from Michael Towers (larch) and on the implementation of initscripts-extras-fbsplash which currently uses the strings passed to stat_busy and stat_done for this. More hooks can be added if requested. The implementation uses associative arrays and will thus only work with bash 4 or later
2009-08-22Allow skipping of all hardware clock adjustmentsDan McGee1
For virtualized machines, the hardware clock doesn't actually exist, so all hwclock calls fail and print error messages during system startup, shutdown, and the hourly adjtime cronjob. By explicitly looking for HARDWARECLOCK to be set to 'UTC' or 'localtime', all other values will result in hwclock calls being skipped (e.g. set the variable to 'none'). Signed-off-by: Dan McGee <dan@archlinux.org>
2009-08-22Remove USEDIRECTISA and associated codeDan McGee1
man hwclock implies this option is rarely necessary, and (almost) all systems Arch supports surely have a /dev/rtc device and load the rtc driver in the kernel. Even if this is not available, hwclock will fall back to direct I/O requests anyway. As a side note, the adjtime cronjob didn't even respect this setting anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-08-03Fix array syntax for DAEMONS loopAaron Griffin1
Whoops! Noticed-by: Florian Pritz <f-p@gmx.at> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-30Add _netdev support to netfs (also add glusterfs support)Marco Lima1
The system-wide mount will no longer mount items in fstab marked as _netdev (requires a network device). These _netdev items are handled by the netfs daemon now. Additionally, add support for glusterfs :) Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-30Shutdown non-rc.conf daemons firstAaron Griffin1
Flip the order in which daemons are shutdown. First we scan for all daemons that are NOT in rc.conf and shut those down (order is based on ls, so it is dependent on LC_COLLATE). Afterwards, we shut down all daemons in rc.conf, in order Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-18Fix incomplete elif statement2009.07-2Allan McRae1
Commit 92cbc62e introduced an incomplete elif statement which caues shutdown to fail. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-06-26Don't change hardwareclock if settings unclearGerhard Brauer1
Don't default to 'localtime' if HARDWARECLOCK is not set to UTC. Check explicit values Ref: FS#15263 Edited-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-07Fix array count/walk in rc.shutdown and rc.single, see #13263Thomas Bächler1
2009-03-10Create /var/lib/misc if it doesn't exist2009.03-2Thomas Bächler1
This is necessary because the filesystem package doesn't currently contain this directory
2009-02-11Fix bug #13205: better random-seed entropyThomas Bächler1
- For the random-seed file location to be more "FHS compliant" is better to put in /var/lib/misc/random-seed (Variable state information, that persists after reboot) than the /var/run/random-seed (Run-time variable data, that not necessarily persists after reboot) for example with /var/run mounted as TMPFS. - The random-seed file permision should be "0600" not "0644" - The size of random-seed acording to random(4) manpage should be the size specified in "/proc/sys/kernel/random/poolsize" in other case 512 bytes.
2008-07-18Remount filesystems RO if umounting failsAaron Griffin1
Just a safeguard, suggested by FS#10947 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>