Can't restart Nginx - Nginx: Job for nginx.service failed because the control process exited

Hi, My website www.thetechminute.com hosted via ServerPilot has been down since I last rebooted my Linode server.

When I try to restart Nginx, I get the following error

Nginx: Job for nginx.service failed because the control process exited with error code. See 'Systemctl status nginx-sp.service' and 'journalclt -xe' for details.

This is what I get if enter systemctl status nginx-sp service

● nginx-sp.service - nginx-sp
Loaded: loaded (/lib/systemd/system/nginx-sp.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Tue 2021-01-05 13:31:37 UTC; 21s ago
Process: 6293 ExecStartPre=/opt/sp/nginx/sbin/nginx -t (code=exited, status=1/FAILURE)

Jan 05 13:31:36 localhost systemd[1]: nginx-sp.service: Control process exited, code=exited st
Jan 05 13:31:36 localhost systemd[1]: Failed to start nginx-sp.
Jan 05 13:31:36 localhost systemd[1]: nginx-sp.service: Unit entered failed state.
Jan 05 13:31:36 localhost systemd[1]: nginx-sp.service: Failed with result 'exit-code'.
Jan 05 13:31:37 localhost systemd[1]: nginx-sp.service: Service hold-off time over, scheduling
Jan 05 13:31:37 localhost systemd[1]: Stopped nginx-sp.
Jan 05 13:31:37 localhost systemd[1]: nginx-sp.service: Start request repeated too quickly.
Jan 05 13:31:37 localhost systemd[1]: Failed to start nginx-sp.
Jan 05 13:31:37 localhost systemd[1]: nginx-sp.service: Unit entered failed state.
Jan 05 13:31:37 localhost systemd[1]: nginx-sp.service: Failed with result 'start-limit-hit'.

The command sudo nginx-sp -t return the following error

root@localhost:~# sudo nginx-sp -t
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/v hosts.d/phoencurrent-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/v hosts.d/techswatch-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/v hosts.d/thetechminute-ssl.conf:6
nginx: the configuration file /etc/nginx-sp/nginx.conf syntax is ok
nginx: [emerg] open() "/srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log" failed (2: No such file o r directory)
nginx: configuration file /etc/nginx-sp/nginx.conf test failed

It would be great if anyone can help me diagnose the issue.

2 Replies

Hi,
I'll start with the most immediate error first in your configuration test, which indicated your log file couldn't be opened. You'll need to check and see if the log file at /srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log exists. If it does, check its permissions.
ls -l /srv/users/serverpilot/log/phoencurrent/dev_nginx.access.log
If this doesn't exist, you need to create it as the same user that nginx is being run as, or you need to change the location of the log file itself in the directive mentioned in your nginx configuration file test. Once nginx is able to create and log to its file specified, it should run successfully.

The second thing, which is your warning about the deprecated ssl directive, is less of an issue, though you may look into converting that to use what nginx specified in its test. You could look up something like deprecated ssl directive in nginx configuration, and you should be able to find out how to change that to something that shouldn't give you a warning. After that, your tests should pass with no errors and nginx ought to start and run for you with stability.

Good luck!

Blake

Hi Blake, just wanted to say Thank you giving the necessary information. It was very kind of you! I was able to resolve the issue by creating two directories using the FileZilla client as a Root user.

The same command returned this after creating the directory..

root@localhost:~# sudo nginx-sp -t
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/vhosts.d/phoencurrent-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/vhosts.d/techswatch-ssl.conf:6
nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive instead in /etc/nginx-sp/vhosts.d/thetechminute-ssl.conf:6
nginx: the configuration file /etc/nginx-sp/nginx.conf syntax is ok
nginx: configuration file /etc/nginx-sp/nginx.conf test is successful

Finally restarted Nginx and my blog is back online. Thank you so much.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct