On Do, 23.11.17 00:02, Gena Makhomed ([email protected]) wrote: > On 22.11.2017 23:27, Reindl Harald wrote: > > > > I am use nginx web server (http://nginx.org/) with systemd. > > > But I see errors in /var/log/messages when running nginx: > > > > > > systemd: Starting nginx - high performance web server... > > > systemd: Failed to read PID from file /var/run/nginx.pid: Invalid > > > argument > > > systemd: Started nginx - high performance web server. > > > > > > systemd: Starting nginx - high performance web server... > > > systemd: PID file /var/run/nginx.pid not readable (yet?) after start. > > > systemd: Started nginx - high performance web server > > > either the daemon needs to be fixed > > Ok, but can you tell, what is wrong with daemon? > > this is nginx daemonization code: > http://hg.nginx.org/nginx/file/tip/src/os/unix/ngx_daemon.c
This is not how UNIX daemonization is supposed to work. The daemon is supposed to fork twice: the first child is supposed to call setsid() and then call fork() and then exit(), and the grandchild is then supposed to be the main daemon process, so that: a) it's definitely reparented to PID 1 b) It runs within its own setsid session, that has no leader Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
