Job for nginx.service failed.

Hi all,

I have set up a simple virtual host with this config in nginx.conf file.

events {}
http {
    include mime.types;
    server {
        listen 80;
        server_name  REDUCTED;
        root  /sites/demo;
    }
}

I couldn't run the:

systemctl reload nginx

I get the error message:

Job for nginx.service failed.
See "systemctl status nginx.service" and "journalctl -xe" for details.

And when I check the syntax that's fine.

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Then ran this command journalctl -xe

REDUCTED

Any suggestion how to fix this?

TA

1 Reply

You write:

Any suggestion how to fix this?

The ssh(1) failures are unrelated to your systemd(1)/nginx(8) problem. They are the results of dictionary attacks on your Linode by 'bots running on infected systems around the world. This is easily verified by looking up some of the IP addresses given in your log snippets at

https://ipinfo.io

Regular use of this service requires a subscription but casual, metered use is allowed. Too many/frequent lookups will result in a lockout from the service.

Welcome to life on the open internet!

The only piece of useful evidence is this:

Feb 18 19:09:27 localhost sudo[1132]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/usr/bin/fuser -k 80/tcp
Feb 18 19:09:27 localhost sudo[1132]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Feb 18 19:09:27 localhost systemd[1]: nginx.service: Main process exited, code=killed, status=9/KILL
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit nginx.service has exited.
--
-- The process' exit code is 'killed' and its exit status is 9.
Feb 18 19:09:27 localhost systemd[1]: nginx.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit nginx.service has entered the 'failed' state with result 'signal'.
Feb 18 19:09:27 localhost sudo[1132]: pam_unix(sudo:session): session closed for user root

Someone/-thing killed your systemd(1) job with signal 9 -- SIGKILL. Here's the definition of SIGKILL:

Forcefully terminate a process. Along with SIGSTOP, this is one of two signals which cannot be intercepted, ignored, or handled by the process itself.

My guess is that nginx.service timed out because nginx(8) is misconfigured and didn't start. Just because your configuration passes a syntax/semantic check does not mean it's correct. You can find out what went wrong by checking the log for nginx(8).

I don't use nginx(8) so I can't help you with a correct configuration.

-- sw

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