summaryrefslogtreecommitdiff
path: root/src/shutdown
Commit message (Collapse)AuthorAgeFilesLines
* shutdown: fix spacing in shutdown error messageLennart Poettering2020-05-051-1/+1
|
* shutdown: unregister all binfmt_misc entries before entering shutdown loopLennart Poettering2020-04-231-0/+2
| | | | | | | | Apparently if the new "F" flag is used they might pin files, which blocks us from unmounting things. Let's hence clear this up explicitly. Before entering our umount loop. Fixes: #14981
* Merge pull request #13084 from ddstreet/log_timeLennart Poettering2020-03-301-0/+13
|\ | | | | log: add support for prefixing console log messages with current timestamp
| * log: add support for prefixing console log messages with current timestampDan Streetman2020-02-101-0/+13
| |
* | Fall back to kexec when no kexec binary existsArusekk2020-03-241-0/+3
|/ | | | | | This may be not a popular setup, but in case kexec resides somewhere different than the default location for KEXEC (`/usr/sbin/kexec`), don't just reboot and try doing `reboot(RB_KEXEC)` instead, just like what `kexec -e` normally does.
* umount: when we fail to detach a loopback device, set the auto-clear flagLennart Poettering2019-12-201-1/+24
| | | | | We might get lucky and this cleans up things later on automatically for us.
* umount: check LO_FLAGS_AUTOCLEAR after LOOP_CLR_FD claimed successLennart Poettering2019-12-201-5/+23
| | | | | Fixes: #14410 Replaces: #14386
* umount: detect root loopback device the same way as we detect root DM devicesLennart Poettering2019-12-201-16/+10
| | | | | | | get_block_device() is just the nicer way to do it (since it also odes btrfs). Also, let's already collect the dev_t of the loopback device when we enumerate things, that allows us to do the checks simpler without constantly stat()ing things over and over again.
* umount: show correct error messageLennart Poettering2019-12-201-18/+20
| | | | | | | We fucked up errno vs. r two times, let's correct that. While we are at it, let's handle the error first, like we usually do, and the clean case without indentation.
* umount: remove unneeded variableLennart Poettering2019-12-201-3/+1
|
* umount: line break comments againLennart Poettering2019-12-201-22/+13
| | | | | break them like we usually do, taking our intended line width into account.
* umount: log on all errorsLennart Poettering2019-11-151-2/+2
|
* umount: be happy if /proc/swaps doesn't existLennart Poettering2019-11-151-0/+2
| | | | | | Kernels work without swap just fine. Fixes: #13993
* shutdown: make logging more useful if NULL swap/mount table files are specifiedLennart Poettering2019-11-151-4/+4
| | | | Makes the error output seen in #13993 more readable.
* tree-wide: drop signal.h when signal-util.h is includedYu Watanabe2019-11-041-1/+0
|
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-041-1/+0
|
* tree-wide: drop missing.hYu Watanabe2019-10-311-1/+0
|
* util-lib: move some functions from basic/cgroup-util to shared/cgroup-setupZbigniew Jędrzejewski-Szmek2019-09-161-0/+1
| | | | | | | | | This way less stuff needs to be in basic. Initially, I wanted to move all the parts of cgroup-utils.[ch] that depend on efivars.[ch] to shared, because efivars.[ch] is in shared/. Later on, I decide to split efivars.[ch], so the move done in this patch is not necessary anymore. Nevertheless, it is still valid on its own. If at some point we want to expose libbasic, it is better to to not have stuff that belong in libshared there.
* journald: slightly bump OOM adjust for journald (#13366)Lennart Poettering2019-08-221-1/+0
| | | | | | | | | | | | | | If logging disappears issues are hard to debug, hence let's give journald a slight edge over other services when the OOM killer hits. Here are the special adjustments we now make: systemd-coredump@.service.in OOMScoreAdjust=500 systemd-journald.service.in OOMScoreAdjust=-250 systemd-udevd.service.in OOMScoreAdjust=-1000 (i.e. the coredump processing is made more likely to be killed on OOM, and udevd and journald are less likely to be killed)
* shutdown: merge variable declaration lines a bitLennart Poettering2019-07-131-4/+2
|
* shutdown: bump kmsg log level to LOG_WARNING onlyLennart Poettering2019-07-131-8/+10
| | | | Fixes: #12337
* shutdown: rework bump_sysctl_printk_log_level() to use sysctl_writef()Lennart Poettering2019-07-131-8/+9
|
* shutdown: use "int" for log level typeLennart Poettering2019-07-131-6/+7
| | | | | | | | Let's remove some unnecessary confusion around signed/unsigned types for log levels. Let's just stick to signed, because that is what glibc generally appears to use. While we are at it, add explicit logging for all error causes.
* Replace the legacy ULONG_LONG_MAX with the C99 ULLONG_MAXAdrian Bunk2019-05-171-1/+1
|
* Merge pull request #12218 from keszybz/use-libmount-moreLennart Poettering2019-04-301-9/+4
|\ | | | | Use libmount more
| * Add helper function for mnt_table_parse_{stream,mtab}Zbigniew Jędrzejewski-Szmek2019-04-231-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wraps a few common steps. It is defined as inline function instead of in a .c file to avoid having a .c file. With a .c file, we would have three choices: - either link it into libshared, but then then libshared would have to be linked to libmount. - or compile the .c file into each target separately. This has the disdvantage that configuration of every target has to be updated and stuff will be compiled multiple times anyway, which is not too different from keeping this in the header file. - or create a new convenience library just for this. This also has the disadvantage that the every target would have to be updated, and a separate library for a 10 line function seems overkill. By keeping everything in a header file, we compile this a few times, but otherwise it's the least painful option. The compiler can optimize most of the function away, because it knows if 'source' is set or not.
| * shared/mount-util: convert to libmountZbigniew Jędrzejewski-Szmek2019-04-231-7/+7
| | | | | | | | | | | | | | It seems better to use just a single parsing algorithm for /proc/self/mountinfo. Also, unify the naming of variables in all places that use mnt_table_next_fs(). It makes it easier to compare the different call sites.
* | codespell: fix spelling errorsBen Boeckel2019-04-292-4/+4
|/
* tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0Yu Watanabe2019-04-111-1/+1
|
* Merge pull request #12153 from benjarobin/killall-show-not-killedLennart Poettering2019-04-111-0/+47
|\ | | | | shutdown/killall: Show in the console the processes not yet killed
| * shutdown: Bump sysctl kernel.printk log level in order to see info msgBenjamin Robin2019-04-101-0/+47
| |
* | pid1,shutdown: do not cunescape paths from libmountZbigniew Jędrzejewski-Szmek2019-04-091-22/+18
| | | | | | | | | | The test added in previous commit shows that libmount does the unescaping internally.
* | shared: add a single definition of libmount cleanup functionsZbigniew Jędrzejewski-Szmek2019-04-051-6/+1
|/ | | | | | | | Use a trivial header file to share mnt_free_tablep and mnt_free_iterp. It would be nicer put this in mount-util.h, but libmount.h is not in the default include path, and the build system would have to be adjusted to pass pkg-config include path in various places, and it's just not worth the trouble. A separate header file works nicely.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+3
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* shutdown: rearrange shutdown sources in source treeLennart Poettering2019-03-054-0/+1277
Let's move the shutdown binary into its own subdirectory in src/shutdown, after all it is relatively isolated from the normal PID 1 sources, being a different binary and all. Unfortunately it's not possible to move some of the code, since it is shared with PID 1, that I wished we could move, but I still think it's worth it.