summaryrefslogtreecommitdiff
path: root/src/core/killall.c
AgeCommit message (Collapse)Author
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-06-24use more _cleanup_ macroRonny Chevalier
2014-06-13core: fix invalid free() in killall()Andreas Henriksson
static int killall(....) in ./src/core/killall.c tries to get "s" initialized by calling get_process_comm(...) which calls read_one_line_file(...) which if it fails will mean it is left uninitialized. It is then used in argument to strna(s) call where it is dereferenced(!), in addition to nothing else initializing it before the scope it is in finishes.
2014-01-05shared: procfs_file_alloca: handle pid==0Simon Peeters
when pid is set to 0 use /proc/self
2014-01-02Use format patterns for usec_t, pid_t, nsec_t, usec_tZbigniew Jędrzejewski-Szmek
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.
2013-11-25core: fix order of parameters in broadcast_signal()Lennart Poettering
2013-11-25shutdown: during final killing spree also send SIGHUP in addition to SIGTERM ↵Lennart Poettering
to deal with shells This makes shutdown a bit faster if debug-shell.service is enabled.
2013-06-26killall: do not use alloca() in argument listZbigniew Jędrzejewski-Szmek
It is not allowed.
2013-04-19core/killall: use procfs_file_allocaZbigniew Jędrzejewski-Szmek
2013-04-03core/killall.c: prevent segfault and initialize pidsHarald Hoyer
2013-04-02shutdown: correctly wait for processes we killed in the killall spreeLennart Poettering
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-03-30killall: print notice what we forcefully KILLKay Sievers
2012-07-19killall: avoid gcc warning about wait name clashLennart Poettering
2012-07-17switch-root: don't wait for processesLennart Poettering
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-13core: go on a killing spree when transitioning from initrd to main systemLennart Poettering