aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2019-03-19 23:58:19 +0100
committerDavid Oberhollenzer <goliath@infraroot.at>2019-03-20 14:47:45 +0100
commit4f1b393cee89e57bea8449d5c867a27ba1940bb5 (patch)
treea4604525cae67ad021c27d80ce85c3e2580660ef
parent1850f31d6d1d88621b6891ed05c283e26620a242 (diff)
Dump more information in service status command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
-rw-r--r--cmd/service/status.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/service/status.c b/cmd/service/status.c
index 03ff463..38c1477 100644
--- a/cmd/service/status.c
+++ b/cmd/service/status.c
@@ -28,6 +28,7 @@ static int cmd_status(int argc, char **argv)
init_status_response_t resp;
char tmppath[256];
const char *state;
+ service_t *svc;
for (;;) {
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("\tTemplate name: %s\n", resp.service_name);
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 {
printf("[%s] %s\n", state, resp.filename);
}