Age | Commit message (Collapse) | Author |
|
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This now uses the systemd code, and is in line with do_unlock.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This patch addresses the issues with my previous patch submission here:
https://mailman.archlinux.org/pipermail/arch-projects/2012-June/002990.html
The notable changes between this patch and the previous one are below:
-- this patch does not rename set_timezone()
-- 'filesystems' and 'bash' are left as-is
-- everything is in one patch, not two
-- the 'makedepends' change is no longer relevant because the duplication
of it was already removed in a later commit
Regarding the capitalization of "Btrfs", it seems that upstream prefers
"Btrfs".[1][2]
Regarding 'https://' vs. 'http://', I left this change in the patch
because stating 'https://www.archlinux.org' in the start-up messages
doesn't force anyone to use HTTPS over HTTP. It simply shows that HTTPS
is available for use. If someone really doesn't want to use HTTPS, they
don't have to. Finally, Dan McGee stated that HTTPS will be used all the
time soon.[3]
[1] https://oss.oracle.com/projects/btrfs/
[2] https://btrfs.wiki.kernel.org/index.php/Main_Page
[3] https://bugs.archlinux.org/task/30486#comment96222
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
[tomegun: do the same for startup too]
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This is a deprecated path in sysfs, and the check is illogical.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Explicitly pass "kexec" to the shutdown script if we detect a preloaded
kernel already in memory. We mask read errors for custom kernels where
kexec is not available.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This should have been done together with cb1ddfc15431f2e6498c93cd4da53e14f1147659.
Mea culpa.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This was needed when /etc/mtab was a regular file in order to avoid writing to it
when /etc/ was mounted ro. However, now it is not needed.
Passing -n should have been a noop, except for the NILFS mount helper. It will only
start the daemon if the -n flag is not passed.
This fixes FS#22523.
Tested-by: Alexander Lam <lambchop468@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This would be useful for filesystem monitoring software which needs to
capture all changes to the filesystem - including the final writes to
the random seed and wtmp.
[tomegun: this hook is now the same as the postkillall hook, but that might
change, so I agree with adding it for the sake of having sane semantics.]
Signed-off-by: Devin J. Pohly <djpohly+arch@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Factor out umounting. Explicitly skip umounting API directories, rather
than matching on fs type. This allows us to e.g. unmount all tmpfs but leaving
/run and /dev/shm alone.
v3: fixed some regressions in v2, made 'API filesystems' less general
v2: new umount_all implementation based on proposal by Dave and input from
Anthony. Also, ignore ramfs as it is not backed by swap.
Cc: Dave Reisner <d@falconindy.com>
Cc: C Anthony Risinger <anthony@xtfx.me>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
The new ordering is now:
1) book-keeping
2) shutting down and killing processes
3) swapoff
4) unmounting and tearing down of block devices
The reason to move 1) to the top is so it will not interfere with
the killing of processes. The reason for not moving 3) to the top
as well is that we want to minimize the amount of stuff that has to
be moved from swap to ram.
However, swapoff must happen before 4) as we don't know what is under
the swap device/file.
Added a TODO: unmount any devices backed by swap (tmpfs/ramfs) to make
sure that their contents is thrown away rather than moved to ram. In
principle we might get OOM on shutdown due to the current situation,
but in most cases the only problem should be that shutdown is unecessarily
slow.
Thanks to Dan and Dave for prompting me to look into this.
Cc: Dan McGee <dpmcgee@gmail.com>
Cc: Dave Reisner <d@falconindy.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
udev was receiving some events (due to e.g. swapoff) on shutdown
that caused it to fork new processes. These then receivde TERM before
they could finish, and complained on the console.
In principle, I'm worried that, with the right ammonut of bad luck,
we could fork off some process at exactly the wrong time which escapes
the killall logic.
This, by the way, highlights the frailty of the killall stuff.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This will make sure the same hook is run regardless of whether you pivot
to the shutdown ramfs or not. This is in order to run apcupsd --killpower
as pointed out by Gerardo.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
We do this before killing all processes. There is no reason to do it later,
and this might give some processes a bit more time to terminate properly.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This uses the function introduced in 9b77b7d7b535c3c52c99a95374e1f800466c6414.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
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>
|
|
Tell the /run/initramfs/shutdown what action to preform. Still no kexec support though.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
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>
|
|
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>
|
|
Rationale
Avoid printing any start hook status messages above the head line.
|
|
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>
|
|
Also sanitze the PATH for rc.single, rc.multi, rc.local and daemons.
|
|
|
|
|
|
|
|
|
|
This also keeps all tmpfs allways. Some might be in still in use because of a running splash daemon etc.
|
|
|
|
Error/stat_fail when $TIMEZONE is invalid instead of skipping silently.
|
|
|
|
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
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.
|
|
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This fixes FS#23889.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Conflicts:
rc.shutdown
rc.sysinit
|
|
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
* 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>
|
|
|
|
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.
|
|
This avoids problems with lack of rw filesystems.
Solves: #FS18153.
|
|
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. :(
|
|
Shorten domainname conditional execution.
Use parameter expansion instead of dirname.
Clean up entropy pool saving and system clock saving.
Flatten LVM deactivation if block
|
|
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.
|