Skip to content

Commit 3ff8d4e

Browse files
committed
Move cron job from cron.daily to cron.d and add a random delay
http://cr/2460884 cr:nierzwic,iweller,gafton,tjk
1 parent 2a0d61e commit 3ff8d4e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

srpm/cron_update-motd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
#!/bin/bash
2-
start --quiet update-motd
1+
# Delay a random time between 0 and 360 minutes (6 hours) to avoid having all
2+
# instances update at the same time.
3+
RANDOM_DELAY=360
4+
@daily start --quiet update-motd

srpm/update-motd.spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: update-motd
22
Version: 1.0.1
3-
Release: 1%{?dist}
3+
Release: 2%{?dist}
44
License: ASL 2.0
55
Summary: Framework for dynamically generating MOTD
66
Group: System Environment/Base
@@ -16,14 +16,14 @@ Source3: yum_update-motd.py
1616
Source4: yum_update-motd.conf
1717

1818
%description
19-
Framework and scripts for producing a dynamically generated Message Of The Day.
19+
Framework and scripts for producing a dynamically generated Message Of The Day.
2020
Based on and compatible with the framework implemented Ubuntu.
2121

2222
%install
2323
rm -rf %{buildroot}
2424
install -d %{buildroot}/etc/update-motd.d
2525
install -D -m 0755 %{SOURCE0} %{buildroot}/usr/sbin/update-motd
26-
install -D -m 0755 %{SOURCE1} %{buildroot}/etc/cron.daily/update-motd
26+
install -D -m 0755 %{SOURCE1} %{buildroot}/etc/cron.d/update-motd
2727
install -D -m 0444 %{SOURCE2} %{buildroot}/etc/init/update-motd.conf
2828
install -D -m 0444 %{SOURCE3} %{buildroot}/usr/lib/yum-plugins/update-motd.py
2929
install -D -m 0444 %{SOURCE4} %{buildroot}/etc/yum/pluginconf.d/update-motd.conf
@@ -59,7 +59,7 @@ fi
5959
%defattr(-,root,root,-)
6060
%dir /etc/update-motd.d
6161
%dir /var/lib/update-motd
62-
%config /etc/cron.daily/update-motd
62+
%config /etc/cron.d/update-motd
6363
%config /etc/init/update-motd.conf
6464
%config /etc/yum/pluginconf.d/update-motd.conf
6565
/usr/sbin/update-motd

0 commit comments

Comments
 (0)