Commit graph

32 commits

Author SHA1 Message Date
Lennart Poettering 0bee65f062 shutdown: during final killing spree also send SIGHUP in addition to SIGTERM to deal with shells
This makes shutdown a bit faster if debug-shell.service is enabled.
2013-11-25 22:10:22 +01:00
Karel Zak 4561be3a64 Remove duplicate includes 2013-11-18 20:28:55 -05:00
Lennart Poettering 477def8097 shutdown: unify handling of reboot() syscall a bit 2013-11-08 19:32:45 +01:00
WaLyong Cho 37185ec80a Support additional argument in reboot
reboot syscall can be performed with an additional argument. In some
systems this functionality can be useful to modify the mode of the
next boot performed by the bootloader.
2013-11-07 01:23:54 -05:00
Lennart Poettering 74df0fca09 util: unify reading of /proc/cmdline
Instead of individually checking for containers in each user do this
once in a new call proc_cmdline() that read the file only if we are not
in a container.
2013-11-06 03:15:16 +01:00
Lennart Poettering 41f85451d3 shutdown: trim the cgroup tree on loop iteration
This way we leave the cgroup empty before exiting in a container which
makes sure the container manager will get cgroup notification event

https://bugs.freedesktop.org/show_bug.cgi?id=68370
https://bugzilla.redhat.com/show_bug.cgi?id=988883
2013-11-06 02:31:22 +01:00
Zbigniew Jędrzejewski-Szmek 7801356442 build-sys: discover the path to kexec during build time
https://bugs.freedesktop.org/show_bug.cgi?id=55248
2013-07-15 23:20:56 -04:00
Lennart Poettering f6940be782 shutdown: avoid malloc() if we can 2013-07-11 00:35:01 +02:00
Kay Sievers 8577e67245 shutdown: fix /proc/cmdline reading of 'quiet' 2013-07-11 00:13:46 +02:00
Kay Sievers ec26be514f suppress status message output at shutdown when 'quiet' is given 2013-07-05 00:32:05 +02:00
Lennart Poettering 30d743f430 shutdown: print a nice message before returning to initrd 2013-04-09 18:29:33 +02:00
Lennart Poettering 5989dbb233 shutdown: print a message when storage is finalized 2013-04-08 21:22:14 +02:00
Michal Schmidt 735e071271 shutdown, umount: use verbs consistently
Mounts are "unmounted".
Swaps are "deactivated", not "turned off" nor "disabled".
Loop and DM devices are "detached", not "deleted".

Especially the deleting sounded a bit scary.
2012-12-07 18:55:19 +01:00
Michal Schmidt bce93b7ac7 shutdown, umount: logging improvements
In bugreports about hangs during the late shutdown we are often missing
important information - what were we trying to unmount/detach when it hung.

Instead of printing what we successfully unmounted, print what we are
going to unmount/detach. And add messages to mark the completion of
categories (mount/swap/loop/DM).
2012-12-07 17:44:50 +01:00
Michal Schmidt 2569a5ce16 shutdown: downgrade a warning
All messages of the kind "not all done, %d left" are log_info, except
the one for DM devices. Make it info too.
2012-12-07 17:28:30 +01:00
Tom Gundersen 02eaa78835 shutdown: don't pivot to /run/initramfs if already there
This allows systemd-shutdown to be installed as /run/initramfs/shutdown
and take care of the proper teardown of the rootfs.
2012-11-28 18:26:35 +01:00
Lennart Poettering 0049f05a8b shutdown: readd explicit sync() when shutting down
As it turns out reboot() doesn't actually imply a file system sync, but
only a disk sync. Accordingly, readd explicit sync() invocations
immediately before we invoke reboot().

This is much less dramatic than it might sounds as we umount all
disks/read-only remount them anyway before going down.
2012-11-16 01:35:11 +01:00
Lennart Poettering cb7ec5645e shutdown: in containers, invoke reboot(2), too. Then fallback to exit() if CAP_SYS_BOOT is missing
The kernel's PID namespaces support reboot(2) just fine, so let's make
use of it if possible.
2012-09-05 15:55:40 -07:00
Lennart Poettering 57371e5829 shutdown: remove explicit sync() invocations
The kernel implicitly does sync() anyway, hence there is no need to do
that in userspace explicitly. This makes the "-n" switch to halt(8) a
noop.
2012-09-05 15:32:57 -07:00
Lennart Poettering f47fc35555 switch-root: remount to MS_PRIVATE
The kernel does not allow switching roots if things are mounted
MS_SHARED. As a work-around, remount things MS_PRIVATE before switching
roots.

This should be fixed in the kernel for good.

https://bugzilla.redhat.com/show_bug.cgi?id=847418
2012-08-12 01:31:03 +02:00
Dave Reisner 4bfa638d43 shutdown: recursively mark root as private before pivot
Because root is now recursively marked as shared on bootup, we need to
recursively mark root as private. This prevents a pivot_root failure on
shutdown:

  Cannot finalize remaining file systems and devices, giving up.
  pivot failed: Invalid argument
2012-08-10 17:59:33 +02:00
Lennart Poettering cee530bb23 switch-root: don't wait for processes
When we transition from the initrd to the main system, don't reap
processes, so that they can be handled normally after deserialization.
2012-07-17 17:44:26 +02:00
Ville Skyttä 49f43d5f91 Spelling fixes. 2012-07-16 12:16:29 +02:00
Lennart Poettering 39d6464ce3 shutdown: add missing include 2012-07-13 21:54:28 +02:00
Lennart Poettering 910212e738 container: when shutting down in a container don't detach loop devices
We don't do device handling in containers, hence no loop devices either.
2012-07-13 14:42:25 +02:00
Lennart Poettering bd3fa1d243 core: go on a killing spree when transitioning from initrd to main system 2012-07-13 14:41:57 +02:00
Lennart Poettering cd3bd60a2e switch-root: reopen /dev/console before we switch root 2012-07-10 19:19:59 +02:00
Kay Sievers d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Lennart Poettering 6edd7d0a09 sleep: implement suspend/hibernate as first class targets 2012-05-08 13:54:23 +02:00
Lennart Poettering b55d0651c0 shutdown: don't complain if we cannot lock memory, to make container shutdowns clean 2012-04-24 16:56:06 +02:00
Lennart Poettering ff64462375 shutdown: don't try to shut down DM devices in a container 2012-04-22 15:50:52 +02:00
Lennart Poettering 146de8175e shutdown: move shutdown to core since it replaces PID 1 2012-04-12 14:18:36 +02:00
Renamed from src/shutdown.c (Browse further)