2021年1月29日星期五

RANDOM_DELAY is not applied to the default /etc/cron.d/update-motd on Amazon Linux 2

On Amazon Linux 2, RANDOM_DELAY is not applied to the default job ( /etc/cron.d/update-motd ).

All scripts related to motd ( message of the day ) are provided when the instance is launched and I have not changed any of them. Nevertheless, update-motd runs at the same time every day. Could you please tell me the cause?

At 03:26 daily, this command will be executed from within /etc/update-motd.d/70-available-updates .

-------- start Fri Jan 29 03:26:04 UTC 2021  USER       PID   LWP %CPU NLWP %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND  root      0000  0000 23.5    1 13.4 362776 65956 ?        R    03:26   0:00 /usr/bin/python /usr/bin/yum --debuglevel 2 --security check-update  

The OS version:

uname -a    Linux ip-000-000-000-000.ap-northeast-1.compute.internal 4.14.177-139.253.amzn2.x86_64 #1 SMP Wed Apr 29 09:56:20 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux  

The content of update-motd:

cat /etc/cron.d/update-motd    # Delay a random time between 0 and 360 minutes (6 hours) to avoid having all  # instances update at the same time.  RANDOM_DELAY=360  @daily root /usr/bin/systemctl --quiet restart update-motd  
cat /etc/update-motd.d/70-available-updates    #!/bin/bash    # Possible summaries include:  # No packages needed for security; %d packages available  # %d package(s) needed[ (+%d related)] for security, out of %d available  # There are [[%d security update(s)[ out of ]%d total update(s)]] available  LANG=C timeout 30s /usr/bin/yum \      --debuglevel 2 \      --security check-update 2>/dev/null \          | grep -P '(?<! 0 packages) available$' \      && echo 'Run "sudo yum update" to apply all updates.'  
https://stackoverflow.com/questions/65963953/random-delay-is-not-applied-to-the-default-etc-cron-d-update-motd-on-amazon-lin January 30, 2021 at 10:05AM

没有评论:

发表评论