chiark / gitweb /
shutdown: Adding binary to shutdown the system
authorFabiano Fidencio <fidencio@profusion.mobi>
Thu, 7 Oct 2010 11:24:41 +0000 (04:24 -0700)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2010 17:23:46 +0000 (19:23 +0200)
commitb1b2a107d15a370d40b200172837bdd82ff3c3b2
treee0a7726091f28047f0fb5958b1c3fdb21224030f
parente3478379751fda30316204c68112b5a2b9ffd5a7
shutdown: Adding binary to shutdown the system

This functions are working as follows:
   - Send a SIGTERM to all processes that may be finished
   - Send a SIGKILL to all processes that still live and may be finished
   - Try to unmount all mount points
   - Try to remount read-only all mount points that can't be umounted
   - Umount all swap devices
   - Umount and detach all loopback devices
   - Call [poweroff|halt|reboot|kexec]

TODO:
   - Umount device-mapper.
   - Make log work. So far it is being useless as we do not parse
     /etc/systemd/system.conf, kernel command line but just
     environment, however we're executed by init and thus have no
     useful variables. Forcing it to target=kmsg/console and
     level=debug also does not produce any output, however writing to
     /dev/console does work (hack used during debug).
Makefile.am
src/shutdown.c [new file with mode: 0644]