Randomize lfd-cron call

Post Reply
Junior Member
Posts: 4
Joined: 20 Feb 2018, 19:10

Randomize lfd-cron call

Post by PH-Quentin2 »

Hello to you the ConfigServer team.

Firstly I want to congratulate you for the excellent work that you realized this year, it is very appreciated! I hope that the year 2019 will be as good in features :-)

This topic about a small issue/overload increase on a VPS node at midnight, after checking it would appear to be the CRON defined in /etc/cron.d/lfd-cron

Code: Select all

[root@cPanel ~]# cat /etc/cron.d/lfd-cron 
0 0 * * * root /usr/sbin/csf --lfd restart > /dev/null 2>&1
This restart is really quick but it's look make some checksum in /usr/bin/, /usr/sbin/ and /bin/:

Code: Select all

/usr/bin/md5sum --check /var/lib/csf/csf.tempint
lfd - messenger csf...
lfd - sleeping
[root@cPanel ~]# cat /var/lib/csf/csf.tempint | wc -c
=> 209863 files are checked during the CSF restart X guest hosts on the same node.

We like the features "System Integrity Checking" but in this case we prefer to launch it not in the same to spread the load/iowait :-)

We have tried to randomize the call to this restart like this:

Code: Select all

sed -i "s/0 0 * * */$(( $RANDOM % 10 )) $(( $RANDOM % 10 )) * * */" /etc/cron.d/lfd-cron
However, this file is overwritten with each CSF update:[/b]

Code: Select all

[root@cPanel ~]# stat /etc/cron.d/lfd-cron
  File: ‘/etc/cron.d/lfd-cron’
  Size: 74        	Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d	Inode: 26494092    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-12-27 23:17:11.704332671 +0100
Modify: 2018-12-05 06:42:04.131057712 +0100
Change: 2018-12-05 06:42:05.118033505 +0100
 Birth: -
First, what is the usefulness of the restart lfd if the process is already started?

Second, could we have a configuration that would launch this CRON at different times of the day for each guest host?

A big thank you for reading this message/request.

Post Reply