systemd-analyze: added the verb unit-gdb to spawn and attach gdb
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "errno-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-table.h"
|
||||
@@ -319,3 +320,15 @@ int parse_signo(const char *s, int *ret) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sigterm_process_group_handler(int signal, siginfo_t *info, void *ucontext) {
|
||||
assert(signal == SIGTERM);
|
||||
assert(info);
|
||||
|
||||
/* If the sender is not us, propagate the signal to all processes in
|
||||
* the same process group */
|
||||
if (si_code_from_process(info->si_code) &&
|
||||
pid_is_valid(info->si_pid) &&
|
||||
info->si_pid != getpid_cached())
|
||||
(void) kill(0, signal);
|
||||
}
|
||||
|
||||
@@ -93,3 +93,5 @@ static inline bool si_code_from_process(int si_code) {
|
||||
|
||||
return si_code < 0 || IN_SET(si_code, SI_USER, SI_QUEUE);
|
||||
}
|
||||
|
||||
void sigterm_process_group_handler(int signal, siginfo_t *info, void *ucontext);
|
||||
|
||||
Reference in New Issue
Block a user