Skip to content

check-ncm-cdispd does not restart the services if it crashes #65

@aka7

Description

@aka7

Since the move to systemd unit file, if ncm-dispd process dies check-ncm-cdispd script does not start it. If proccess dies, cron logs shows this.


Redirecting to /bin/systemctl status ncm-cdispd.service
Daemon ncm-cdispd has been intentionally stopped. Not restarted.

even though it was NOT stopped intentionally.

reason


# systemctl status ncm-cdispd
* ncm-cdispd.service - Configuration Dispatch Daemon waits for new incoming configuration profiles
   Loaded: loaded (/usr/lib/systemd/system/ncm-cdispd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2025-06-22 02:10:53 EDT; 4 weeks 1 days ago
 Main PID: 940 (ncm-cdispd)
   CGroup: /system.slice/ncm-cdispd.service
           `-940 /usr/bin/perl -Tw /usr/sbin/ncm-cdispd
........

# echo $?
0
# kill -9 940
# systemctl status ncm-cdispd
* ncm-cdispd.service - Configuration Dispatch Daemon waits for new incoming configuration profiles
   Loaded: loaded (/usr/lib/systemd/system/ncm-cdispd.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Mon 2025-07-21 14:39:38 EDT; 13s ago
  Process: 940 ExecStart=/usr/sbin/ncm-cdispd (code=killed, signal=KILL)
 Main PID: 940 (code=killed, signal=KILL)
# echo $?
3

status code from systemclt is 3 regardless of if process crashes or is stopped. Therefore, it always hits this, https://github.com/quattor/ncm-cdispd/blob/main/src/main/scripts/check-ncm-cdispd#L23

since its now systemd unit file, I think fix here is to add restart=on-failure in unit file. https://github.com/quattor/ncm-cdispd/blob/main/src/main/resources/systemd/ncm-cdispd.service

look to perhaps add

[Service]
Restart=on-failure
RestartSec=5

and git rid of check-ncm-cdispd and the cron ? thoughts?

I added this through template dropin file, and seems to work during my tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions