mirror of
https://github.com/pygos/init.git
synced 2024-11-22 03:09:46 +01:00
Dump more information in service status command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
1850f31d6d
commit
4f1b393cee
1 changed files with 16 additions and 0 deletions
|
@ -28,6 +28,7 @@ static int cmd_status(int argc, char **argv)
|
||||||
init_status_response_t resp;
|
init_status_response_t resp;
|
||||||
char tmppath[256];
|
char tmppath[256];
|
||||||
const char *state;
|
const char *state;
|
||||||
|
service_t *svc;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
i = getopt_long(argc, argv, short_opts, long_opts, NULL);
|
i = getopt_long(argc, argv, short_opts, long_opts, NULL);
|
||||||
|
@ -125,6 +126,21 @@ static int cmd_status(int argc, char **argv)
|
||||||
printf("\tStatus: %s\n", state);
|
printf("\tStatus: %s\n", state);
|
||||||
printf("\tTemplate name: %s\n", resp.service_name);
|
printf("\tTemplate name: %s\n", resp.service_name);
|
||||||
printf("\tExit status: %d\n", resp.exit_status);
|
printf("\tExit status: %d\n", resp.exit_status);
|
||||||
|
|
||||||
|
svc = loadsvc(SVCDIR, resp.filename,
|
||||||
|
RDSVC_NO_EXEC | RDSVC_NO_DEPS |
|
||||||
|
RDSVC_NO_CTTY | RDSVC_NO_FNAME);
|
||||||
|
|
||||||
|
if (svc == NULL) {
|
||||||
|
fputs("\tError loading service file\n", stdout);
|
||||||
|
} else {
|
||||||
|
printf("\tDescription: %s\n", svc->desc);
|
||||||
|
printf("\tType: %s\n",
|
||||||
|
svc_type_to_string(svc->type));
|
||||||
|
printf("\tTarget: %s\n",
|
||||||
|
svc_target_to_string(svc->target));
|
||||||
|
delsvc(svc);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("[%s] %s\n", state, resp.filename);
|
printf("[%s] %s\n", state, resp.filename);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue