nxt_runtime.c (1305:966d691dab2c) nxt_runtime.c (1403:1cee885b7f10)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 679 unchanged lines hidden (view full) ---

688 rt->auxiliary_threads = 2;
689 rt->user_cred.user = NXT_USER;
690 rt->group = NXT_GROUP;
691 rt->pid = NXT_PID;
692 rt->log = NXT_LOG;
693 rt->modules = NXT_MODULES;
694 rt->state = NXT_STATE;
695 rt->control = NXT_CONTROL_SOCK;
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 679 unchanged lines hidden (view full) ---

688 rt->auxiliary_threads = 2;
689 rt->user_cred.user = NXT_USER;
690 rt->group = NXT_GROUP;
691 rt->pid = NXT_PID;
692 rt->log = NXT_LOG;
693 rt->modules = NXT_MODULES;
694 rt->state = NXT_STATE;
695 rt->control = NXT_CONTROL_SOCK;
696 rt->tmp = NXT_TMP;
696
697 nxt_memzero(&rt->capabilities, sizeof(nxt_capabilities_t));
698
699 if (nxt_runtime_conf_read_cmd(task, rt) != NXT_OK) {
700 return NXT_ERROR;
701 }
702
703 if (nxt_capability_set(task, &rt->capabilities) != NXT_OK) {

--- 126 unchanged lines hidden (view full) ---

830 "option \"--control\" requires socket address\n";
831 static const char no_user[] = "option \"--user\" requires username\n";
832 static const char no_group[] = "option \"--group\" requires group name\n";
833 static const char no_pid[] = "option \"--pid\" requires filename\n";
834 static const char no_log[] = "option \"--log\" requires filename\n";
835 static const char no_modules[] =
836 "option \"--modules\" requires directory\n";
837 static const char no_state[] = "option \"--state\" requires directory\n";
697
698 nxt_memzero(&rt->capabilities, sizeof(nxt_capabilities_t));
699
700 if (nxt_runtime_conf_read_cmd(task, rt) != NXT_OK) {
701 return NXT_ERROR;
702 }
703
704 if (nxt_capability_set(task, &rt->capabilities) != NXT_OK) {

--- 126 unchanged lines hidden (view full) ---

831 "option \"--control\" requires socket address\n";
832 static const char no_user[] = "option \"--user\" requires username\n";
833 static const char no_group[] = "option \"--group\" requires group name\n";
834 static const char no_pid[] = "option \"--pid\" requires filename\n";
835 static const char no_log[] = "option \"--log\" requires filename\n";
836 static const char no_modules[] =
837 "option \"--modules\" requires directory\n";
838 static const char no_state[] = "option \"--state\" requires directory\n";
839 static const char no_tmp[] = "option \"--tmp\" requires directory\n";
838
839 static const char help[] =
840 "\n"
841 "unit options:\n"
842 "\n"
843 " --version print unit version and configure options\n"
844 "\n"
845 " --no-daemon run unit in non-daemon mode\n"

--- 8 unchanged lines hidden (view full) ---

854 " default: \"" NXT_LOG "\"\n"
855 "\n"
856 " --modules DIRECTORY set modules directory name\n"
857 " default: \"" NXT_MODULES "\"\n"
858 "\n"
859 " --state DIRECTORY set state directory name\n"
860 " default: \"" NXT_STATE "\"\n"
861 "\n"
840
841 static const char help[] =
842 "\n"
843 "unit options:\n"
844 "\n"
845 " --version print unit version and configure options\n"
846 "\n"
847 " --no-daemon run unit in non-daemon mode\n"

--- 8 unchanged lines hidden (view full) ---

856 " default: \"" NXT_LOG "\"\n"
857 "\n"
858 " --modules DIRECTORY set modules directory name\n"
859 " default: \"" NXT_MODULES "\"\n"
860 "\n"
861 " --state DIRECTORY set state directory name\n"
862 " default: \"" NXT_STATE "\"\n"
863 "\n"
864 " --tmp DIRECTORY set tmp directory name\n"
865 " default: \"" NXT_TMP "\"\n"
866 "\n"
862 " --user USER set non-privileged processes to run"
863 " as specified user\n"
864 " default: \"" NXT_USER "\"\n"
865 "\n"
866 " --group GROUP set non-privileged processes to run"
867 " as specified group\n"
868 " default: ";
869

--- 91 unchanged lines hidden (view full) ---

961
962 p = *argv++;
963
964 rt->state = p;
965
966 continue;
967 }
968
867 " --user USER set non-privileged processes to run"
868 " as specified user\n"
869 " default: \"" NXT_USER "\"\n"
870 "\n"
871 " --group GROUP set non-privileged processes to run"
872 " as specified group\n"
873 " default: ";
874

--- 91 unchanged lines hidden (view full) ---

966
967 p = *argv++;
968
969 rt->state = p;
970
971 continue;
972 }
973
974 if (nxt_strcmp(p, "--tmp") == 0) {
975 if (*argv == NULL) {
976 write(STDERR_FILENO, no_tmp, nxt_length(no_tmp));
977 return NXT_ERROR;
978 }
979
980 p = *argv++;
981
982 rt->tmp = p;
983
984 continue;
985 }
986
969 if (nxt_strcmp(p, "--no-daemon") == 0) {
970 rt->daemon = 0;
971 continue;
972 }
973
974 if (nxt_strcmp(p, "--version") == 0) {
975 write(STDERR_FILENO, version, nxt_length(version));
976 exit(0);

--- 650 unchanged lines hidden ---
987 if (nxt_strcmp(p, "--no-daemon") == 0) {
988 rt->daemon = 0;
989 continue;
990 }
991
992 if (nxt_strcmp(p, "--version") == 0) {
993 write(STDERR_FILENO, version, nxt_length(version));
994 exit(0);

--- 650 unchanged lines hidden ---