My customer with this issue hasn't had the CPD defunct process situation escalate to total server outage yet. I have Nagios monitoring the system process counts frequently, so I am able to get to it and restart CPD with the "cpwd_admin" commands in a controlled state.
If you're desperate, make yourself a cron job to do it, too.
EDIT: I made a real script today that will do everything we need (MDS top-level, MDS per-domain, SMS, EPM, SME) and posted it in the ToolBox:
https://community.checkpoint.com/t5/Scripts/Restart-CPD-script/m-p/217862/highlight/true#M1159
[Expert@cpmgmt01:0]# ./cpd_restart.sh -h
cpd_restart.sh: Restart CPD process on Multi-Domain server and Security/Endpoint management
Usage: ./cpd_restart.sh [ -d [ ALL | <specific domain server> ] | [ -h ]
Options:
d Specify a single domain management server (CMA) or special word ALL for all domain
servers listed in "mdsstat" output (Optional; only relevant for MDS)
h This help
If no argument is given, then the top level CPD process is restarted (for the MDS itself,
Security Management server, or Endpoint Management server)
Run it with a "-d ..." to restart CPD on a given domain server if that's your troublesome one, or "-d ALL" to restart CPD on all domain servers. This only restarts CPD and leaves the other processes alone, so there's no outage. It uses the same methods that Check Point's own scripts use (shameless stole the commands out of $MDSDIR/scripts/cpshared). This ensures CPD restart is done the correct way and gets re-attached to CPWD for monitoring.
If you just have a single Security Management server, then don't give any arguments and it'll just restart the one process, or the MDS root CPD process.
Put that script in /home/admin, chmod 755, then set a job in CLISH:
> add cron job CPD_Restart command "/home/admin/cpd_restart.sh" recurrence hourly hours all at 00
> show cron job CPD_Restart recurrence
Every day at every hour at the 00 minutes.
or for MDS:
> add cron job CPD_Restart command "/home/admin/cpd_restart.sh" recurrence hourly hours all at 00
> add cron job CPD_Restart_domains command "/home/admin/cpd_restart.sh -d ALL" recurrence hourly hours all at 05
> show cron job CPD_Restart recurrence
Every day at every hour at the 00 minutes.
> show cron job CPD_Restart_domains recurrence
Every day at every hour at the 05 minutes.