aboutsummaryrefslogtreecommitdiff
path: root/src/genrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/genrc.c')
-rw-r--r--src/genrc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/genrc.c b/src/genrc.c
index 92b0fac..d4904b6 100644
--- a/src/genrc.c
+++ b/src/genrc.c
@@ -34,27 +34,29 @@ struct option longopts[] = {
{ "command", required_argument, 0, 'c' },
{ "program", required_argument, 0, 'p' },
{ "pid-from", required_argument, 0, 'P' },
{ "pidfile", required_argument, 0, 'F' },
{ "timeout", required_argument, 0, 't' },
{ "signal-reload", required_argument, 0, OPT_SIGNAL_RELOAD },
{ "no-reload", no_argument, 0, OPT_NO_RELOAD },
{ "signal-stop", required_argument, 0, OPT_SIGNAL_STOP },
{ "sentinel", no_argument, 0, 'S' },
{ "create-pidfile", required_argument, 0, OPT_CREATE_PIDFILE },
{ "version", no_argument, 0, OPT_VERSION },
{ "verbose", no_argument, 0, 'v' },
+ { "user", required_argument, 0, 'u' },
+ { "group", required_argument, 0, 'g' },
{ NULL }
};
-char shortopts[] = "c:hF:P:p:St:v";
+char shortopts[] = "c:hF:g:P:p:St:u:v";
struct sigdefn {
char const *sig_name;
int sig_no;
};
#define S(s) { #s, s }
static struct sigdefn sigdefn[] = {
S (SIGHUP),
S (SIGINT),
S (SIGQUIT),
S (SIGILL),
@@ -377,42 +379,48 @@ main(int argc, char **argv)
case 'p':
setenv("GENRC_PROGRAM", optarg, 1);
break;
case 'P':
setenv("GENRC_PID_FROM", optarg, 1);
break;
case 'F':
p = xmalloc(6 + strlen(optarg));
strcat(strcpy(p, "FILE:"), optarg);
setenv("GENRC_PID_FROM", p, 1);
free(p);
break;
+ case 'g':
+ setenv("GENRC_GROUP", optarg, 1);
+ break;
case OPT_CREATE_PIDFILE:
setenv("GENRC_CREATE_PIDFILE", optarg, 1);
break;
case 't':
setenv("GENRC_TIMEOUT", optarg, 1);
break;
case 'S':
setenv("GENRC_SENTINEL", "1", 1);
break;
case OPT_NO_RELOAD:
no_reload = 1;
break;
case OPT_SIGNAL_RELOAD:
setenv("GENRC_SIGNAL_RELOAD", optarg, 1);
break;
case OPT_SIGNAL_STOP:
setenv("GENRC_SIGNAL_STOP", optarg, 1);
break;
+ case 'u':
+ setenv("GENRC_USER", optarg, 1);
+ break;
case 'v':
genrc_verbose++;
break;
default:
exit(1);
}
}
if ((p = getenv("GENRC_COMMAND")) != NULL)
genrc_command = p;
if ((p = getenv("GENRC_PROGRAM")) != NULL)
genrc_program = p;

Return to:

Send suggestions and report system problems to the System administrator.