Evgeniy Berdnikov
November 24, 2017 03:08AM
On Fri, Nov 24, 2017 at 07:12:31AM +0300, Maxim Dounin wrote:
> + if (read(pp[0], buf, 1) != 1) {
> + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "read() pipe failed");
> + return NGX_ERROR;
> + }
> +
> + if (close(pp[0]) == -1) {
> + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "close() failed");

"close() pipe failed"

> + return NGX_ERROR;
> + }
> +
> exit(0);
> }
>
> @@ -68,3 +98,26 @@
>
> return NGX_OK;
> }
> +
> +
> +ngx_int_t
> +ngx_daemon_sync(ngx_log_t *log)
> +{
> + if (ngx_daemon_fd == NGX_INVALID_FILE) {
> + return NGX_OK;
> + }
> +
> + if (write(ngx_daemon_fd, "", 1) != 1) {
> + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "write() failed");

"write() pipe failed"

> + return NGX_ERROR;
> + }
> +
> + if (close(ngx_daemon_fd) == -1) {
> + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "close() failed");

"close() pipe failed"

> + return NGX_ERROR;

Можно ещё заменить "pp" на "sync_fd" / "sync_pipe".
--
Eugene Berdnikov
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 21, 2017 03:48PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 22, 2017 12:44PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 08:52AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 10:40AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 11:30AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Igor Sysoev November 23, 2017 11:46AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 12:18PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 12:34PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 12:14PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 02:02PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 04:02PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 06:14PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 11:14PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Evgeniy Berdnikov November 24, 2017 03:08AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Vadim A. Misbakh-Soloviov November 24, 2017 04:18AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 24, 2017 08:00AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 24, 2017 06:32AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Vadim A. Misbakh-Soloviov November 24, 2017 06:38AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Konstantin Tokarev November 24, 2017 06:46AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Pavel V. November 24, 2017 07:00AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 24, 2017 08:36AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 24, 2017 09:50AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Vadim A. Misbakh-Soloviov November 24, 2017 10:14AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 24, 2017 02:46PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 25, 2017 09:24AM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Slawa Olhovchenkov November 25, 2017 09:38AM

Re:systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Konstantin Tokarev November 25, 2017 08:48PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

S.A.N November 23, 2017 12:30PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Gena Makhomed November 23, 2017 12:56PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Maxim Dounin November 23, 2017 12:58PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Илья Шипицин November 23, 2017 01:32PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Konstantin Pavlov November 23, 2017 03:08PM

Re: systemd: PID file /var/run/nginx.pid not readable (yet?) after start.

Evgeniy Berdnikov November 23, 2017 02:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 59
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready