2

On CentOS 7 I wanted to check the status of the nginx service:

# systemctl status nginx -l
nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled)
   Active: inactive (dead)

Jun 30 03:40:08 dev01 systemd[1]: [/usr/lib/systemd/system/nginx.service:13]
Failed to parse kill mode, ignoring mixed

So then I enabled it: # systemctl enable nginx and checked it again:

# systemctl status nginx -l
nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
   Active: inactive (dead)

Jun 30 03:40:08 dev01 systemd[1]: [/usr/lib/systemd/system/nginx.service:13]
Failed to parse kill mode, ignoring mixed

Jun 30 03:40:21 dev01 systemd[1]: [/usr/lib/systemd/system/nginx.service:13]
Failed to parse kill mode, ignoring mixed

What is this error? And how come every time I do: # systemctl enable nginx, the status adds another copy of the error at the bottom. I did the enable like 4 or 5 times in a row and then status shows like 5 of these errors. What is this error about?

Also, when I finally start the service, all these errors disappear from the status.

3
  • Where did you get nginx from? Jun 30, 2015 at 1:57
  • From yum from epel. Jun 30, 2015 at 2:12
  • That's a bit odd. I always use the nginx.org upstream packages anyway, so I have never seen this. Jun 30, 2015 at 2:16

2 Answers 2

2

systemd logs all messages (startup/stop) to /var/log/message using syslog, the errors line you see are basically all matching lines for "nginx" with tail option. Its something =~ grep nginx | tail which will display the last 10 lines of the /var/log/message for "nginx" grep. Basically systemctl displays last 10 lines from log to help user identify the issue.

    [root@puppetmaster ~]# grep nginx /var/log/messages| tail
    Jul  1 05:59:50 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 05:59:57 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:05:35 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:23:30 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:23:34 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:23:46 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:27:07 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:27:19 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:27:24 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
    Jul  1 06:27:28 localhost systemd: [/usr/lib/systemd/system/nginx.service:13] Failed to parse kill mode, ignoring: mixed
3
  • If you run enable multiple times its going to create only one symlink ln -s '/usr/lib/systemd/system/nginx.service' '/etc/systemd/system/multi-user.target.wants/nginx.service' which will allow this services to start up with system boot. Use systemctl list-unit-files| grep nginx to check if the service is enabled.
    – chetangb
    Jun 30, 2015 at 19:36
  • So when I do systemctl status myservice it shows the status and then the last 10 log entries? Jun 30, 2015 at 20:28
  • yes, absolutely..
    – chetangb
    Jun 30, 2015 at 20:29
0

Regarding the part about "Failed to parse kill mode, ignoring mixed". CentOS 7 doesn't support this mode. I am not sure when it was added to systemd, but on CentOS 7 I use "KillMode=process". The reason I use process instead of the default which is control-group is because my daemon creates children processes that I monitor and control and don't like when systemd kills them off while stopping the main daemon.

See "man systemd.kill" for more information.

KillMode=mixed is supported in the Fedora 21 system I test with though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .