Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941784 - www-servers/nginx-1.27.2 fails to start with systemd: open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
Summary: www-servers/nginx-1.27.2 fails to start with systemd: open() "/run/nginx/ngin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-18 21:39 UTC by Louis Sautier (sbraz)
Modified: 2024-11-04 09:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
nginx-fix-systemd-service.patch (file_941784.txt,456 bytes, patch)
2024-10-18 21:39 UTC, Louis Sautier (sbraz)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Sautier (sbraz) gentoo-dev 2024-10-18 21:39:08 UTC
Created attachment 906323 [details, diff]
nginx-fix-systemd-service.patch

This is caused by https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=108a642ef4da9fa6ae4f0d33580a05cea3f70678
Oct 18 22:20:23 localhost systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct 18 22:20:24 localhost nginx[1487]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Oct 18 22:20:24 localhost nginx[1487]: nginx: [emerg] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
Oct 18 22:20:24 localhost nginx[1487]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 18 22:20:24 localhost systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 18 22:20:24 localhost systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 18 22:20:24 localhost systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

I suggest something like the attached nginx-fix-systemd-service.patch to fix its startup
Comment 1 Larry the Git Cow gentoo-dev 2024-10-19 14:44:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f136d56a588639697e42a27391f83483d333e0e

commit 6f136d56a588639697e42a27391f83483d333e0e
Author:     Louis Sautier <sbraz@gentoo.org>
AuthorDate: 2024-10-19 14:36:26 +0000
Commit:     Louis Sautier <sbraz@gentoo.org>
CommitDate: 2024-10-19 14:44:24 +0000

    www-servers/nginx: fix systemd unit to create /run/nginx/ (#941784)
    
    108a642ef4da broke the systemd service, by moving the PID file to
    /run/nginx/ without creating the directory, resulting in 'open()
    "/run/nginx/nginx.pid" failed (2: No such file or directory)'
    
    Bug: https://bugs.gentoo.org/939560
    Closes: https://bugs.gentoo.org/941784
    Signed-off-by: Louis Sautier <sbraz@gentoo.org>

 www-servers/nginx/files/nginx.service-r1                             | 1 +
 www-servers/nginx/{nginx-1.26.2-r3.ebuild => nginx-1.26.2-r4.ebuild} | 0
 www-servers/nginx/{nginx-1.27.2.ebuild => nginx-1.27.2-r1.ebuild}    | 0
 3 files changed, 1 insertion(+)