sm

sysmgr implemented in C
git clone git://git.ckyln.com/sm
Log | Files | Refs | README | LICENSE

commit 987450201e369225531a784730c1109f69787fd3
parent 83d41391e4dd5ce72a39328466648124100a309c
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 10 Oct 2020 14:28:53 +0300

sysmgr: print variables on usage

Diffstat:
Msysmgr.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sysmgr.c b/sysmgr.c @@ -69,6 +69,7 @@ void usage(void) { printf("usage: %s\n\nSee sysmgr(8) for detailed information.\n\nVersion: %s\n", argv0, VERSION); + printf("Service Directory: %s\nRun directory: %s\n", sysdir, rundir); exit(1); } @@ -78,13 +79,13 @@ int main(int argc, char *argv[]) argv0 = argv[0]; char sysmgr_pidfile[PATH_MAX]; - if (argc > 1) - usage(); - sysdir = getenv_fallback("SYSDIR", sysdir_default); rundir = getenv_fallback("RUNDIR", rundir_default); snprintf(sysmgr_pidfile, PATH_MAX, "%s/pid", rundir); + if (argc > 1) + usage(); + mkdirp(rundir); /* Trap signals */