From 9aaa7d8c20e58ed380225cbbbd05248539d2f500 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Sat, 26 Aug 2017 13:37:44 +0300 Subject: Added configure option --user=USER and --group=GROUP. --- src/nxt_runtime.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nxt_runtime.c') diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index 59b209aa..d6518fbe 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -699,8 +699,8 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt) rt->master_process = 1; rt->engine_connections = 256; rt->auxiliary_threads = 2; - rt->user_cred.user = "nobody"; - rt->group = NULL; + rt->user_cred.user = NXT_USER; + rt->group = NXT_GROUP; rt->pid = NXT_PID; rt->log = NXT_LOG; @@ -757,6 +757,8 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt) "nginext version: " NXT_VERSION "\n" "configured as ./configure" NXT_CONFIGURE_OPTIONS "\n"; + static const char no_user[] = "option \"--user\" requires username\n"; + static const char no_group[] = "option \"--group\" requires group name\n"; static const char no_pid[] = "option \"--pid\" requires filename\n"; static const char no_log[] = "option \"--log\" requires filename\n"; @@ -805,8 +807,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt) if (nxt_strcmp(p, "--user") == 0) { if (*argv == NULL) { - nxt_log(task, NXT_LOG_CRIT, - "no argument for option \"--user\""); + write(STDERR_FILENO, no_user, sizeof(no_user) - 1); return NXT_ERROR; } @@ -819,8 +820,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt) if (nxt_strcmp(p, "--group") == 0) { if (*argv == NULL) { - nxt_log(task, NXT_LOG_CRIT, - "no argument for option \"--group\""); + write(STDERR_FILENO, no_group, sizeof(no_group) - 1); return NXT_ERROR; } -- cgit