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.

Jake Wilson
  • 8,814
  • 29
  • 97
  • 125

2 Answers2

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
chetangb
  • 145
  • 6
  • 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 '15 at 19:36
  • So when I do `systemctl status myservice` it shows the status and then the last 10 log entries? – Jake Wilson Jun 30 '15 at 20:28
  • yes, absolutely.. – chetangb Jun 30 '15 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.