summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
committerDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
commitd76761901c4084bcdbc5a449e9bbb47d56b7093c (patch)
treeb4b7b4e3d588b73a2adcc0094cab466d9194c679 /src/nxt_runtime.c
parentc43629880472bba8d389dfb0b7ae6d883b0ba499 (diff)
parent088117008c9e8f397a58cc8d8070ce047beff12f (diff)
downloadunit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.gz
unit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.bz2
Merge tag '1.32.0' into branches/packaging1.32.0-1
Unit 1.32.0 release.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r--src/nxt_runtime.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index 9bfabc75..0e7f879e 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -956,6 +956,12 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
static const char no_control[] =
"option \"--control\" requires socket address\n";
+ static const char no_control_mode[] =
+ "option \"--control-mode\" requires a mode\n";
+ static const char no_control_user[] =
+ "option \"--control-user\" requires a username\n";
+ static const char no_control_group[] =
+ "option \"--control-group\" requires a group name\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";
@@ -984,6 +990,13 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
" --control ADDRESS set address of control API socket\n"
" default: \"" NXT_CONTROL_SOCK "\"\n"
"\n"
+ " --control-mode MODE set mode of the control API socket\n"
+ " default: 0600\n"
+ "\n"
+ " --control-user USER set the owner of the control API socket\n"
+ "\n"
+ " --control-group GROUP set the group of the control API socket\n"
+ "\n"
" --pid FILE set pid filename\n"
" default: \"" NXT_PID "\"\n"
"\n"
@@ -1032,6 +1045,48 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
continue;
}
+ if (nxt_strcmp(p, "--control-mode") == 0) {
+ if (*argv == NULL) {
+ write(STDERR_FILENO, no_control_mode,
+ nxt_length(no_control_mode));
+ return NXT_ERROR;
+ }
+
+ p = *argv++;
+
+ rt->control_mode = strtoul(p, NULL, 8);
+
+ continue;
+ }
+
+ if (nxt_strcmp(p, "--control-user") == 0) {
+ if (*argv == NULL) {
+ write(STDERR_FILENO, no_control_user,
+ nxt_length(no_control_user));
+ return NXT_ERROR;
+ }
+
+ p = *argv++;
+
+ rt->control_user = p;
+
+ continue;
+ }
+
+ if (nxt_strcmp(p, "--control-group") == 0) {
+ if (*argv == NULL) {
+ write(STDERR_FILENO, no_control_group,
+ nxt_length(no_control_group));
+ return NXT_ERROR;
+ }
+
+ p = *argv++;
+
+ rt->control_group = p;
+
+ continue;
+ }
+
if (nxt_strcmp(p, "--user") == 0) {
if (*argv == NULL) {
write(STDERR_FILENO, no_user, nxt_length(no_user));