mirror of
https://github.com/systemd/systemd.git
synced 2025-08-24 09:49:49 +03:00
systemctl: show process type along process exit codes
This commit is contained in:
@ -1615,6 +1615,8 @@ finish:
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef struct ExecStatusInfo {
|
typedef struct ExecStatusInfo {
|
||||||
|
char *name;
|
||||||
|
|
||||||
char *path;
|
char *path;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
|
||||||
@ -1632,6 +1634,7 @@ typedef struct ExecStatusInfo {
|
|||||||
static void exec_status_info_free(ExecStatusInfo *i) {
|
static void exec_status_info_free(ExecStatusInfo *i) {
|
||||||
assert(i);
|
assert(i);
|
||||||
|
|
||||||
|
free(i->name);
|
||||||
free(i->path);
|
free(i->path);
|
||||||
strv_free(i->argv);
|
strv_free(i->argv);
|
||||||
free(i);
|
free(i);
|
||||||
@ -1850,7 +1853,7 @@ static void print_status_info(UnitStatusInfo *i) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
t = strv_join(p->argv, " ");
|
t = strv_join(p->argv, " ");
|
||||||
printf("\t Process: %u (%s, code=%s, ", p->pid, strna(t), sigchld_code_to_string(p->code));
|
printf("\t Process: %u %s=%s (code=%s, ", p->pid, p->name, strna(t), sigchld_code_to_string(p->code));
|
||||||
free(t);
|
free(t);
|
||||||
|
|
||||||
if (p->code == CLD_EXITED) {
|
if (p->code == CLD_EXITED) {
|
||||||
@ -2083,6 +2086,11 @@ static int status_property(const char *name, DBusMessageIter *iter, UnitStatusIn
|
|||||||
if (!(info = new0(ExecStatusInfo, 1)))
|
if (!(info = new0(ExecStatusInfo, 1)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
if (!(info->name = strdup(name))) {
|
||||||
|
free(info);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
if ((r = exec_status_info_deserialize(&sub, info)) < 0) {
|
if ((r = exec_status_info_deserialize(&sub, info)) < 0) {
|
||||||
free(info);
|
free(info);
|
||||||
return r;
|
return r;
|
||||||
|
Reference in New Issue
Block a user