When I restart Nagios (v 4.3.4) using the command file, I always end up with a least 4 defunct nagios processes:
In the log file there seems to be nothing wrong:ps -ef | grep nagios
avahi 324 1 0 10:18 ? 00:00:00 avahi-daemon: running [nagioshome.local]
nagios 31085 1 0 17:38 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 31122 31085 0 17:38 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 31295 31085 0 17:41 ? 00:00:00 [nagios] <defunct>
nagios 31297 31085 0 17:41 ? 00:00:00 [nagios] <defunct>
nagios 31298 31085 0 17:41 ? 00:00:00 [nagios] <defunct>
nagios 31299 31085 0 17:41 ? 00:00:00 [nagios] <defunct>
nagios 31329 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 31330 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 31331 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 31332 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 31333 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 31334 31085 0 17:41 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
root 31351 6453 0 17:41 pts/0 00:00:00 grep nagios
[1508514083] EXTERNAL COMMAND: RESTART_PROGRAM;
[1508514083] PROGRAM_RESTART event encountered, restarting...
[1508514083] Event broker module 'NERD' deinitialized successfully.
[1508514083] livestatus: Socket thread has terminated
[1508514083] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' deinitialized successfully.
[1508514083] Nagios 4.3.4 starting... (PID=31085)
[1508514083] Local time is Fri Oct 20 17:41:23 CEST 2017
[1508514083] LOG VERSION: 2.0
[1508514083] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1508514083] qh: core query handler registered
[1508514083] nerd: Channel hostchecks registered successfully
[1508514083] nerd: Channel servicechecks registered successfully
[1508514083] nerd: Channel opathchecks registered successfully
[1508514083] nerd: Fully initialized and ready to rock!
[1508514083] wproc: Successfully registered manager as @wproc with query handler
[1508514083] wproc: Registry request: name=Core Worker 31329;pid=31329
[1508514083] wproc: Registry request: name=Core Worker 31331;pid=31331
[1508514083] wproc: Registry request: name=Core Worker 31330;pid=31330
[1508514083] wproc: Registry request: name=Core Worker 31332;pid=31332
[1508514083] wproc: Registry request: name=Core Worker 31333;pid=31333
[1508514083] wproc: Registry request: name=Core Worker 31334;pid=31334
[1508514083] livestatus: Livestatus 1.2.5i6p4 by Mathias Kettner. Socket: '/usr/local/nagios/var/rw/live'
[1508514083] livestatus: Please visit us at http://mathias-kettner.de/
[1508514083] livestatus: Hint: please try out OMD - the Open Monitoring Distribution
[1508514083] livestatus: Please visit OMD at http://omdistro.org
[1508514083] livestatus: Warning: environment_macros are enabled. This might decrease the overall nagios performance
[1508514083] livestatus: Finished initialization. Further log messages go to /usr/local/nagios/var/livestatus.log
[1508514083] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' initialized successfully.
[1508514083] TIMEPERIOD TRANSITION: 24x7;-1;1
[1508514083] TIMEPERIOD TRANSITION: 24x7_sans_holidays;-1;1
[1508514083] TIMEPERIOD TRANSITION: none;-1;0
[1508514083] TIMEPERIOD TRANSITION: us-holidays;-1;0
[1508514083] TIMEPERIOD TRANSITION: workhours;-1;0