summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main_process.c
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2019-03-01 18:30:09 +0300
committerAndrei Belov <defan@nginx.com>2019-03-01 18:30:09 +0300
commit3c3720cba7154bc168cbd00c74817626bb53e140 (patch)
treeda1500f7c6bd5e90ecf45299b6f4b19a29d521cd /src/nxt_main_process.c
parent315a864c27aa27a48c013c4a1ef67a099ffea894 (diff)
parentdf02b03824065389c73213b19736140442cf63bc (diff)
downloadunit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.gz
unit-3c3720cba7154bc168cbd00c74817626bb53e140.tar.bz2
Merged with the default branch.
Diffstat (limited to 'src/nxt_main_process.c')
-rw-r--r--src/nxt_main_process.c66
1 files changed, 50 insertions, 16 deletions
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c
index 819ed44c..f756bff7 100644
--- a/src/nxt_main_process.c
+++ b/src/nxt_main_process.c
@@ -52,6 +52,8 @@ static void nxt_main_process_sigusr1_handler(nxt_task_t *task, void *obj,
void *data);
static void nxt_main_process_sigchld_handler(nxt_task_t *task, void *obj,
void *data);
+static void nxt_main_process_signal_handler(nxt_task_t *task, void *obj,
+ void *data);
static void nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid);
static void nxt_main_stop_worker_processes(nxt_task_t *task, nxt_runtime_t *rt);
static void nxt_main_port_socket_handler(nxt_task_t *task,
@@ -68,6 +70,7 @@ static void nxt_main_port_access_log_handler(nxt_task_t *task,
const nxt_sig_event_t nxt_main_process_signals[] = {
+ nxt_event_signal(SIGHUP, nxt_main_process_signal_handler),
nxt_event_signal(SIGINT, nxt_main_process_sigterm_handler),
nxt_event_signal(SIGQUIT, nxt_main_process_sigquit_handler),
nxt_event_signal(SIGTERM, nxt_main_process_sigterm_handler),
@@ -216,12 +219,38 @@ static nxt_conf_map_t nxt_ruby_app_conf[] = {
};
+static nxt_conf_map_t nxt_java_app_conf[] = {
+ {
+ nxt_string("classpath"),
+ NXT_CONF_MAP_PTR,
+ offsetof(nxt_common_app_conf_t, u.java.classpath),
+ },
+ {
+ nxt_string("webapp"),
+ NXT_CONF_MAP_CSTRZ,
+ offsetof(nxt_common_app_conf_t, u.java.webapp),
+ },
+ {
+ nxt_string("options"),
+ NXT_CONF_MAP_PTR,
+ offsetof(nxt_common_app_conf_t, u.java.options),
+ },
+ {
+ nxt_string("unit_jars"),
+ NXT_CONF_MAP_CSTRZ,
+ offsetof(nxt_common_app_conf_t, u.java.unit_jars),
+ },
+
+};
+
+
static nxt_conf_app_map_t nxt_app_maps[] = {
{ nxt_nitems(nxt_external_app_conf), nxt_external_app_conf },
{ nxt_nitems(nxt_python_app_conf), nxt_python_app_conf },
{ nxt_nitems(nxt_php_app_conf), nxt_php_app_conf },
{ nxt_nitems(nxt_perl_app_conf), nxt_perl_app_conf },
{ nxt_nitems(nxt_ruby_app_conf), nxt_ruby_app_conf },
+ { nxt_nitems(nxt_java_app_conf), nxt_java_app_conf },
};
@@ -889,6 +918,14 @@ nxt_main_process_sigchld_handler(nxt_task_t *task, void *obj, void *data)
static void
+nxt_main_process_signal_handler(nxt_task_t *task, void *obj, void *data)
+{
+ nxt_trace(task, "signal signo:%d (%s) recevied, ignored",
+ (int) (uintptr_t) obj, data);
+}
+
+
+static void
nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid)
{
nxt_buf_t *buf;
@@ -1116,24 +1153,23 @@ nxt_main_listening_socket(nxt_sockaddr_t *sa, nxt_listening_socket_t *ls)
break;
}
- goto next;
- }
-
+ } else
#endif
+ {
+ switch (err) {
- switch (err) {
-
- case EACCES:
- ls->error = NXT_SOCKET_ERROR_PORT;
- break;
+ case EACCES:
+ ls->error = NXT_SOCKET_ERROR_PORT;
+ break;
- case EADDRINUSE:
- ls->error = NXT_SOCKET_ERROR_INUSE;
- break;
+ case EADDRINUSE:
+ ls->error = NXT_SOCKET_ERROR_INUSE;
+ break;
- case EADDRNOTAVAIL:
- ls->error = NXT_SOCKET_ERROR_NOADDR;
- break;
+ case EADDRNOTAVAIL:
+ ls->error = NXT_SOCKET_ERROR_NOADDR;
+ break;
+ }
}
ls->end = nxt_sprintf(ls->start, ls->end, "bind(\\\"%*s\\\") failed %E",
@@ -1143,8 +1179,6 @@ nxt_main_listening_socket(nxt_sockaddr_t *sa, nxt_listening_socket_t *ls)
#if (NXT_HAVE_UNIX_DOMAIN)
-next:
-
if (sa->u.sockaddr.sa_family == AF_UNIX) {
char *filename;
mode_t access;