I have ubuntu server with nginx that crashing from time to time and i cant handle why.
Ubuntu 20.04.4 Nginx version: nginx/1.18.0 (Ubuntu)
2022/11/22 22:14:11 [info] 4076541#4076541: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:102 2022/11/22 22:14:12 [notice] 4076546#4076546: signal process started 2022/11/22 22:14:15 [notice] 4076550#4076550: signal process started 2022/11/22 22:14:18 [notice] 4076553#4076553: signal process started 2022/11/22 22:14:18 [error] 4076553#4076553: open() "/run/nginx.pid" failed (2: No such file or directory)
What should I do to fix this?
My nginx working well now, and after: ‘systemctl start nginx.service’ nginx started without any errors but from practice if i’ll wait some time (it’s may be day or one week) nginx will crash again
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
Indeed as Sergio mentioned, it is best to check the
/var/log/syslogfor more information no why the service might be crashing.
I’ve seen a similar problem in the past caused by Certbot.
The following lines in the renewal config files at
/etc/letsencrypt/renewal/*with outdated versions of Certbot might cause the problem:
What I had to do was to upgrade Cerbot to the latest version:
After that upgrade the
post_hooklines should no longer be in the renewal config files.
Hope that this helps!
It is difficult to find out the problem without more information.
Is there anything relevant in /var/log/syslog?
The official nginx debugging page may be helpful.
It may also be that the process works correctly and that at a specific moment a process reach the memory limit that your Droplet supports and it is crashed, it would be enough to add more memory to your droplet.
Hope that helps you,