Commit Graph

68 Commits

Author SHA1 Message Date
Tiago de Bem Natel de Moura
c554941b4f Initial applications isolation support using Linux namespaces. 2019-09-19 15:25:23 +03:00
Max Romanov
1b7514dca3 Destroying pool in case of error.
This closes #233 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2019-03-22 15:32:40 +03:00
Valentin Bartenev
6cc4080af2 Removed unused "--upstream" command line option. 2018-10-23 18:55:16 +03:00
Valentin Bartenev
029c1a9f50 Renamed "go" application type to "external".
There's nothing specific to Go language.  This type of application object can
be used to run any external application that utilizes libunit API.
2018-10-09 17:53:31 +03:00
Valentin Bartenev
8d844bc2aa Controller: certificates storage interface. 2018-09-20 15:27:08 +03:00
Max Romanov
ec1af82323 Stopping all application processes if router process dies.
Unit master process restarts the router if the router accidentally dies.
New router process receives the configuration from controller and starts
configured applications.  The information of running applications cannot
be transferred to router because currently there is no persistent application
identifier.  To avoid orphan application processes started by died router,
master process stops all currently running applications once it receives
SIGCHLD for router process.
2018-08-10 19:27:15 +03:00
Igor Sysoev
606eda045b Removed '\r' and '\n' artifact macros. 2018-06-25 16:56:45 +03:00
Valentin Bartenev
1a52d876f7 Introduced nxt_length() macro. 2018-06-25 16:51:47 +03:00
Igor Sysoev
3ad1acca12 Fixed exit status on start failure.
This and previous commit close #131 issue on GitHub.
2018-06-18 17:14:32 +03:00
Igor Sysoev
cb36b07686 Removing Unix control socket on start failure.
The bug had appeared in 5cc5002a788e when process type has been
converted to bitmask. This commit reverts the type back to a number.

This commit is related to #131 issue on GitHub.
2018-06-18 17:14:30 +03:00
Igor Sysoev
6273819080 Removed unused single process type. 2018-06-18 17:14:25 +03:00
Valentin Bartenev
b06a0c95d0 Removed duplicating socket address parsing function.
This also fixes #101 issue on GitHub.  The function previously used to
parse IPv6 address of control socket was broken.  Now the working function
is used instead.
2018-04-18 17:28:22 +03:00
Valentin Bartenev
555141f798 Improved "unitd" command line help. 2018-04-13 20:07:02 +03:00
Igor Sysoev
5177b085b1 nxt_lvlhsh_each() refactoring and nxt_lvlhsh_each_init(). 2018-03-29 16:35:42 +03:00
Igor Sysoev
5a9c23e2b4 Using nxt_lvlhsh_peek() for port hashes. 2018-03-29 16:35:38 +03:00
Igor Sysoev
bd451a50a9 Removed unused macros and functions. 2018-03-29 16:35:03 +03:00
Valentin Bartenev
912a49c609 Reduced number of critical log levels. 2018-03-05 17:32:50 +03:00
Sergey Kandaurov
771e9d3cc3 Fixed formatting in nxt_sprintf() and logging. 2018-01-24 15:16:33 +03:00
Max Romanov
6bbed85899 Fixing Coverity warnings.
CID 200496
CID 200494
CID 200490
CID 200489
CID 200483
CID 200482
CID 200472
CID 200465
2017-11-20 17:08:29 +03:00
Max Romanov
6532e46465 Supporting concurrent shared memory fd receive in router.
Two different router threads may send different requests to single
application worker.  In this case shared memory fds from worker
to router will be send over 2 different router ports.  These fds
will be received and processed by different threads in any order.

This patch made possible to add incoming shared memory segments in
arbitrary order.  Additionally, array and memory pool are no longer
used to store segments because of pool's single threaded nature.

Custom array-like structure nxt_port_mmaps_t introduced.
2017-10-19 17:36:56 +03:00
Valentin Bartenev
e4bea2c75c Optimized application type handling. 2017-10-10 19:15:08 +03:00
Valentin Bartenev
096562c0b1 Improved applications versions handling. 2017-10-05 16:46:18 +03:00
Max Romanov
e44401a0bb Introducing process use counter.
This helps to decouple process removal from port memory pool cleanups.
2017-10-04 15:02:11 +03:00
Max Romanov
f869bf1b02 Return error codes for port_hash operations. 2017-10-04 15:02:00 +03:00
Max Romanov
6a64533fa3 Introducing use counters for port and app. Thread safe port write.
Use counter helps to simplify logic around port and application free.

Port 'post' function introduced to simplify post execution of particular
function to original port engine's thread.

Write message queue is protected by mutex which makes port write operation
thread safe.
2017-10-04 14:58:47 +03:00
Max Romanov
414d508e04 Using engine memiory pool for port write allocations.
To allow use port from different threads, the first step is to avoid using
port's memory pool for temporary allocations required to send data through
the port.  Including but not limited by:
  - buffers for data;
  - send message structures;
  - new mmap fd notifications;

It is still safe to use port memory pool for incoming buffers allocations
because recieve operation bound to single thread.
2017-10-04 14:58:13 +03:00
Max Romanov
ba31199786 Removing mem_pool from port_hash interface.
Memory pool is not used by port_hash and it was a mistake to pass it into
'add' and 'remove' functions.  port_hash enrties are allocated from heap.
2017-10-04 14:57:56 +03:00
Valentin Bartenev
45c1d41f34 Removed fibers from compilation.
It's not used anyway, but breaks building with musl.

This closes issue #5 on GitHub.
2017-09-22 16:42:42 +03:00
Valentin Bartenev
4953e5b5cb Configuration persistence.
Now configuration survives server reloads.
2017-09-10 06:22:15 +03:00
Igor Sysoev
58907888e5 Style fixes. 2017-09-06 02:30:55 +03:00
Igor Sysoev
738ca54ded Changed modules names format. 2017-08-31 00:42:16 +03:00
Igor Sysoev
f0e9e3ace9 nginext has been renamed to unit. 2017-08-31 00:42:16 +03:00
Max Romanov
9791b09ce3 Fixed pid_file pattern misprint introduced in 231:6832cdee961e. 2017-08-30 11:50:16 -07:00
Igor Sysoev
a812579842 Adding a missing slash to the tail of path set by --modules
command line option.
2017-08-30 21:44:39 +03:00
Igor Sysoev
9d487df10d The master process has been renamed to the main process. 2017-08-29 02:59:35 +03:00
Igor Sysoev
946867febe Improved English. 2017-08-29 02:22:22 +03:00
Igor Sysoev
93f7104a65 Added configure and command line option --help. 2017-08-26 13:37:44 +03:00
Igor Sysoev
0d65c896cf Added configure and command line option --control. 2017-08-26 13:37:44 +03:00
Igor Sysoev
7f5b57bfb9 Added configure and command line option --modules. 2017-08-26 13:37:44 +03:00
Igor Sysoev
9aaa7d8c20 Added configure option --user=USER and --group=GROUP. 2017-08-26 13:37:44 +03:00
Igor Sysoev
e64494ba2c Added configure option --pid=FILE.
A pid file name can be relative.
The default pid file name is "nginext.pid".
2017-08-26 13:37:44 +03:00
Igor Sysoev
d3a6d7805f Added configure options --prefix=PATH and --log=FILE.
A prefix is prepended to all relative names at configure stage.
There is no prefix by default.

A log file name can be relative.
The default log file name is "nginext.log".
2017-08-26 13:37:44 +03:00
Valentin Bartenev
2caa5cb845 Fixed building by GCC after 924c70e5fd1f. 2017-08-24 19:51:13 +03:00
Igor Sysoev
b84aa64dcb Removed configure option --no-threads. 2017-08-24 17:43:32 +03:00
Igor Sysoev
8b4b52ae3b Checking invalid command line options. 2017-08-24 17:43:31 +03:00
Igor Sysoev
1e53ff184c Added command line option --version. 2017-08-24 17:29:57 +03:00
Igor Sysoev
259b90b9d7 Removed command line option --workers. 2017-08-24 17:29:53 +03:00
Igor Sysoev
6ef9fb7d97 Renamed command line option --no-daemonize to --no-daemon. 2017-08-24 17:29:43 +03:00
Igor Sysoev
949548da29 The new module configuration interface.
Configuration and building example:

  ./configure
  ./configure python
  ./configure php
  ./configure go
  make all

or

  ./configure
  make nginext
  ./configure python
  make python
  ./configure php
  make php
  ./configure go
  make go

Modules configuration options and building examples:

  ./configure python --module=python2 --config=python2.7-config
  make python2

  ./configure php --module=php7 --config=php7.0-config
                  --lib-path=/usr/local/php7.0
  make php7

  ./configure go --go=go1.6 --go-path=${HOME}/go1.6
  make go1.6
2017-08-17 21:47:19 +03:00
Ruslan Ermilov
23d38a5794 Corrected path to nxt_socket.h in comments. 2017-08-16 14:16:14 +03:00