aboutsummaryrefslogtreecommitdiff
path: root/src/genrc.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-05-17 21:49:55 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-05-17 21:49:55 +0300
commited8389beadb7cf1f8d95fe7addbc9ff2783f4d07 (patch)
treeaec21dde26528bf29fdcb232df0b997601e15c4e /src/genrc.c
parent41e4cf7b5ad33dcfc7f472b9392831fa197fd8e2 (diff)
downloadgenrc-ed8389beadb7cf1f8d95fe7addbc9ff2783f4d07.tar.gz
genrc-ed8389beadb7cf1f8d95fe7addbc9ff2783f4d07.tar.bz2
Improve help output
Diffstat (limited to 'src/genrc.c')
-rw-r--r--src/genrc.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/genrc.c b/src/genrc.c
index d4904b6..ae3070d 100644
--- a/src/genrc.c
+++ b/src/genrc.c
@@ -152,55 +152,73 @@ sig_name_to_str(char const *s)
}
char const *help_msg[] = {
"Usage: genrc [OPTIONS] COMMAND",
"generic system initialization script helper\n",
"COMMANDs are:\n",
" start start the program",
" stop stop the program",
" restart restart the running program",
" reload send a reload signal to the program",
" status display the program status",
"",
- "OPTIONs are:\n",
- " -h, --help display this help list",
- " --usage display short usage information",
+ "OPTIONs are:",
+ "",
+ "Command to run:",
+ "",
" -c, --command=COMMAND command line to run",
" -p, --program=PROGRAM name of the program to run",
+ "",
+ " At least one of COMMAND or PROGRAM must be given.",
+ " If PROGRAM is supplied, but COMMAND is not, COMMAND is set to PROGRAM",
+ " Otherwise, if COMMAND is set, but PROGRAM is not, PROGRAM is set to the",
+ " first word (in the shell sense) in COMMAND.",
+ "",
+ "Runtime privileges:",
+ "",
+ " -u, --user=NAME run with this user privileges",
+ " -g, --group=GROUP[,GROUP...]]",
+ " run with this group(s) privileges",
+ "",
+ "Additional configuration:",
+ "",
+ " -t, --timeout=SECONDS time to wait for the program to start up or",
+ " terminate",
+ " --sentinel PROGRAM runs in foreground; disconnect from the",
+ " controlling terminal, run it and act as a sentinel",
" -P, --pid-from=SOURCE where to look for PIDs of the running programs",
" -F, --pidfile=NAME name of the PID file",
" (same as --pid-from=FILE:NAME)",
- " -t, --timeout=SECONDS time to wait for the program to start up or",
- " terminate",
" --signal-reload=SIG signal to send on reload (default: SIGHUP)",
" setting to 0 is equivalent to --no-reload",
" --no-reload makes reload equivalent to restart",
" --signal-stop=SIG signal to send in order to terminate the program",
" (default: SIGTERM)",
- " --sentinel PROGRAM runs in foreground; disconnect from the",
- " controlling terminal, run it and act as a sentinel",
+ "",
+ "Informational options:",
+ "",
+ " -h, --help display this help list",
+ " --usage display short usage information",
" --version display program version and exist",
"",
"Influential environment variables and corresponding options:",
"",
" GENRC_COMMAND=COMMAND --command=COMMAND",
" GENRC_PROGRAM=NAME --program=NAME",
" GENRC_PID_FROM=SOURCE --pid-from=SOURCE",
" GENRC_TIMEOUT=SECONDS --timeout=SECONDS",
" GENRC_SENTINEL=1 --sentinel",
+ " GENRC_USER=NAME --user=NAME",
+ " GENRC_GROUP=GROUPS --group=GROUPS",
"",
- " At least one of COMMAND or PROGRAM must be given.",
- " If PROGRAM is supplied, but COMMAND is not, COMMAND is set to PROGRAM",
- " Otherwise, if COMMAND is set, but PROGRAM is not, PROGRAM is set to the",
- " first word (in the shell sense) in COMMAND.",
"",
"PID sources:",
"",
" FILE:<NAME>",
" Read PID from the file <NAME>",
"",
" CONFIG:<LANG>:<FILENAME>:<FQRN>",
" Name of the PID file is stored in relation <FQRN> of the configuration",
" file <FILENAME>, written in language <LANG>",
"",
" GREP:<FILE>:s/<RX>/<REPL>/[<FLAGS>][;...]",
" Grep for the first line in <FILE> that matches <RX>. If found, process",
@@ -234,37 +252,41 @@ help(void)
int i;
for (i = 0; help_msg[i]; i++)
puts(help_msg[i]);
}
char const *usage_msg[] = {
"genrc",
"[-h]",
"[-F PIDFILE]",
"[-P SOURCE]",
"[-c COMMAND]",
+ "[-g GROUP[,GROUP...]]",
"[-p PROGRAM]",
"[-t SECONDS]",
+ "[-u USER]",
"[--command=COMMAND]",
+ "[--group GROUP[,GROUP...]]",
"[--help]",
"[--no-reload]",
"[--pid-from=SOURCE]",
"[--pidfile=PIDFILE]",
"[--program=PROGRAM]",
"[--sentinel]",
"[--signal-reload=SIG]",
"[--signal-stop=SIG]",
"[--timeout=SECONDS]",
"[--usage]",
+ "[--user=USER]",
"{",
"start",
"|",
"stop",
"|",
"restart",
"|",
"reload",
"|",
"status",
"}",
NULL

Return to:

Send suggestions and report system problems to the System administrator.