mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
coredump: save /proc/[pid]/mountinfo
The file contains information one can use to debug processes running within a container.
This commit is contained in:
parent
a912ab0474
commit
d7032b1fcd
@ -933,11 +933,12 @@ static int process_kernel(int argc, char* argv[]) {
|
||||
/* The larger ones we allocate on the heap */
|
||||
_cleanup_free_ char
|
||||
*core_owner_uid = NULL, *core_open_fds = NULL, *core_proc_status = NULL,
|
||||
*core_proc_maps = NULL, *core_proc_limits = NULL, *core_proc_cgroup = NULL, *core_environ = NULL;
|
||||
*core_proc_maps = NULL, *core_proc_limits = NULL, *core_proc_cgroup = NULL, *core_environ = NULL,
|
||||
*core_proc_mountinfo = NULL;
|
||||
|
||||
_cleanup_free_ char *exe = NULL, *comm = NULL;
|
||||
const char *context[_CONTEXT_MAX];
|
||||
struct iovec iovec[25];
|
||||
struct iovec iovec[26];
|
||||
size_t n_iovec = 0;
|
||||
uid_t owner_uid;
|
||||
const char *p;
|
||||
@ -1110,6 +1111,15 @@ static int process_kernel(int argc, char* argv[]) {
|
||||
IOVEC_SET_STRING(iovec[n_iovec++], core_proc_cgroup);
|
||||
}
|
||||
|
||||
p = procfs_file_alloca(pid, "mountinfo");
|
||||
if (read_full_file(p, &t, NULL) >=0) {
|
||||
core_proc_mountinfo = strappend("COREDUMP_PROC_MOUNTINFO=", t);
|
||||
free(t);
|
||||
|
||||
if (core_proc_mountinfo)
|
||||
IOVEC_SET_STRING(iovec[n_iovec++], core_proc_mountinfo);
|
||||
}
|
||||
|
||||
if (get_process_cwd(pid, &t) >= 0) {
|
||||
core_cwd = strjoina("COREDUMP_CWD=", t);
|
||||
free(t);
|
||||
|
Loading…
Reference in New Issue
Block a user