Introduction
In some rare cases, a long process may hang indefinitely and be difficult for system administrators to detect. The "/usr/local/cpanel/bin/is_script_stuck" script checks how long a script’s current PID has run, and can notify a WHM user or kill the process.
If you want to increase the frequency at which scripts are checked, the following script can be used and is documented at:
Procedure
- SSH into your server as root or access WHM and user Terminal to get a root shell.
- Run the following to open root's crontab.
crontab -e
- Then paste the following line to run the is_script_stuck script every hour at the 15th minute with the timeout set to 12 hours. The script that will be checked is autossl_check.
15 */1 * * * /usr/local/cpanel/bin/is_script_stuck --script=SCRIPT --time=12h --kill --notify=root > /dev/null 2>&1
Where SCRIPT should be replaced with the absolute path of the script - Exit out of the text editor mode used to modify the crontab.
There is no need to restart crond if the crontab command was used to add the cron job.
Comments
0 comments
Article is closed for comments.