Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
November 23, 2017 12:18PM
Hello!

On Thu, Nov 23, 2017 at 07:44:57PM +0300, Igor Sysoev wrote:

> > On 23 Nov 2017, at 19:28, Gena Makhomed <gmm@csdoc.com> wrote:
> >
> > Кстати, Lennart Poettering нашел еще одну ошибку в исходниках nginx:
> > https://lists.freedesktop.org/archives/systemd-devel/2017-November/039832.html
>
> Интересно, откуда он это придумал про двойной fork()?
>
> Во FreeBSD используется только один fork() что в 2017 году:
> https://svnweb.freebsd.org/base/head/lib/libc/gen/daemon.c?revision=326025&view=co
> что в 1994:
> https://svnweb.freebsd.org/base/head/lib/libc/gen/daemon.c?revision=1573&view=co

Двойной форк нужен на Линуксе, чтобы случайно не получить себе
обратно controlling terminal. Документировано, например, тут в
man daemon(3) у glibc,
http://man7.org/linux/man-pages/man3/daemon.3.html:

The GNU C library implementation of this function was taken from BSD,
and does not employ the double-fork technique (i.e., fork(2),
setsid(2), fork(2)) that is necessary to ensure that the resulting
daemon process is not a session leader. Instead, the resulting
daemon is a session leader. On systems that follow System V
semantics (e.g., Linux), this means that if the daemon opens a
terminal that is not already a controlling terminal for another
session, then that terminal will inadvertently become the controlling
terminal for the daemon.

Смысла это делать в nginx'е - скорее нет, IMHO.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
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: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready