1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
Simon Peeters
b68fa010f7 shared: procfs_file_alloca: handle pid==0
when pid is set to 0 use /proc/self
2014-01-05 00:59:13 -05:00
Zbigniew Jędrzejewski-Szmek
ccd06097c7 Use format patterns for usec_t, pid_t, nsec_t, usec_t
It is nicer to predefine patterns using configure time check instead of
using casts everywhere.

Since we do not need to use any flags, include "%" in the format instead
of excluding it like PRI* macros.
2014-01-02 19:45:47 -05:00
Lennart Poettering
6301a98cdf core: fix order of parameters in broadcast_signal() 2013-11-25 23:03:03 +01:00
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
Zbigniew Jędrzejewski-Szmek
5841bd803f killall: do not use alloca() in argument list
It is not allowed.
2013-06-26 19:52:00 -04:00
Zbigniew Jędrzejewski-Szmek
31885cd5e3 core/killall: use procfs_file_alloca 2013-04-19 10:10:41 -04:00
Harald Hoyer
b6e8f1f03d core/killall.c: prevent segfault and initialize pids 2013-04-03 15:17:51 +02:00
Lennart Poettering
aaf7eb81be shutdown: correctly wait for processes we killed in the killall spree
Previously we simply counted how many processes we killed and expected
as many waitpid() calls to succeed. That however is incorrect to do.

As we might kill processes that are not our immediate children, and as
there might be left-over processes in the waitpid() queue from earlier
the we might get more ore less waitpid() events that we expect.

Hence: keep precise track of the processes we kill, remove the ones we
get waitpid() for, and after each time we get SIGCHLD check if all
others still exist. We use getpgid() to check if a PID still exists.

This should fix issues with journald not setting journal files offline
correctly on shutdown, because we'd too quickly proceed from SIGTERM to
SIGKILL because some left-over process was in our waitpid() queue.
2013-04-02 01:28:01 +02:00
Kay Sievers
df758e9875 killall: print notice what we forcefully KILL 2013-03-30 14:19:40 +01:00
Lennart Poettering
3d141780b8 killall: avoid gcc warning about wait name clash 2012-07-19 02:17:11 +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
Lennart Poettering
bd3fa1d243 core: go on a killing spree when transitioning from initrd to main system 2012-07-13 14:41:57 +02:00