Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
How to monitor and 🔄 auto restart cron service in cPanel - PC✗3
How to monitor and 🔄 auto restart cron service in cPanel

How to monitor and 🔄 auto restart cron service in cPanel

Sometimes the crond service fails quite often without any clue and it becomes necessary to monitor the cron service and auto-restart it. cPanel offers ‘chkservd’, a monitoring daemon that monitors the services on the server and restart them if found offline. cPanel/WHM do not provide an option to include the ‘crond’ service under the monitoring daemon, so following are the steps you can follow to achieve it:

Create a crond file under the chkservd.d directory where all the services files are placed:

nano /etc/chkserv.d/crond

Add the following and save the file:

service[crond]=x,x,x,/etc/init.d/crond restart,crond,root
image 23 1024x580 - How to monitor and 🔄 auto restart cron service in cPanel

Now you need to edit the chkservd configuration file and enable the crond service for monitoring:

nano /etc/chkserv.d/chkservd.conf

add the following line at the end of the file

crond:1
image 22 1024x580 - How to monitor and 🔄 auto restart cron service in cPanel

Now, save the file and restart the chkservd service for the new changes to take affect:

/scripts/restartsrv chkservd
image 24 - How to monitor and 🔄 auto restart cron service in cPanel

In order to verify if chkservd auto-restarts the crond service if found offline, stop the service manually

service crond stop

and watch the logs

tail -f /var/log/chkservd.log

You will notice that the crond service is restarted automatically within 5 minutes.

image 34 - How to monitor and 🔄 auto restart cron service in cPanel
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.