Welcome! Log In Create A New Profile

Advanced

Re: Nginx can not use more than 1024 log?

Alexandre
June 29, 2016 07:46AM
Hi Wesley,

I can not get information because the nginx service does not start.

You're right, actually have to use the file
/lib/systemd/system/nginx.service. However, the file does not exist. I
find this file on debian 8 : /run/systemd/generator.late/nginx.service

---
[Unit]
SourcePath=/etc/init.d/nginx
Description=LSB: Stop/start nginx
Before=runlevel2.target runlevel3.target runlevel4.target
runlevel5.target shutdown.target
After=network-online.target remote-fs.target local-fs.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SysVStartPriority=1
ExecStart=/etc/init.d/nginx start
ExecStop=/etc/init.d/nginx stop
ExecReload=/etc/init.d/nginx reload
---

I followed your instructions :

* I create the nginx.service in /lib/systemd/system/nginx.service
* I add "LimitNOFILE=65536"
---
[Unit]
SourcePath=/etc/init.d/nginx
Description=LSB: Stop/start nginx
Before=runlevel2.target runlevel3.target runlevel4.target
runlevel5.target shutdown.target
After=network-online.target remote-fs.target local-fs.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SysVStartPriority=1
ExecStart=/etc/init.d/nginx start
ExecStop=/etc/init.d/nginx stop
ExecReload=/etc/init.d/nginx reload
LimitNOFILE=65536
---
* systemctl daemon-reload && systemctl restart nginx

Now it works perfectly !

Thank you very much Wesley.

I have a question, I use the official repository nginx.
---
deb http://nginx.org/packages/debian/ jessie nginx
deb-src http://nginx.org/packages/debian/ jessie nginx
---

Would it be possible to create the nginx.service file during
installation of nginx?

Thank you the nginx community.

Regards,
Alexandre.


On 29/06/2016 12:21, Sernate wrote:
> Hi,
>
> What does a 'cat /proc/PID/limits' (replace PID with the NGINX PID number)
> show you ?
>
> The limits.conf file does not apply to systemd services.
> Edit the file /lib/systemd/system/nginx.service and within the '[Service]'
> section the following: LimitNOFILE=65536
> After that run: systemctl daemon-reload && systemctl restart nginx
>
> Wesley
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,267940,267949#msg-267949
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx can not use more than 1024 log?

Alexandre June 28, 2016 03:44PM

Re: Nginx can not use more than 1024 log?

Sernate June 29, 2016 06:21AM

Re: Nginx can not use more than 1024 log?

Alexandre June 29, 2016 07:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 273
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready