File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ * Thu Mar 09 2023 Nikhil Dikshit <nikhildi@amazon.com> 2.0-1.amzn2023.0.3
2+ - Migrated Cron job to Systemd timer
3+ - Trigger update-motd.service after cloud-final.service
4+ - Set RemainAfterExit=no on update-motd so that timer can restart it after exit
5+
16* Thu Feb 02 2023 Stewart Smith <trawets@amazon.com> - 2.0-1.amzn2023.0.2
27- Mass rebuild for AL2023
38
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11[Unit]
22Description =Dynamically Generate Message Of The Day
3- After =network-online.target
3+ # running update-motd.service after cloud-final.service, which will be later in the boot process
4+ # this is to avoid running update-motd at the same time with other services such as dnf activities in userdata scripts
5+ After =network-online.target cloud-final.service
46
57[Service]
68Type =oneshot
79ExecStart =/usr/sbin/update-motd
8- RemainAfterExit =yes
10+ # update-motd should not be considered active when its processes have exited
11+ # timer should be able to restart update-motd even after exit
12+ RemainAfterExit =no
913
1014[Install]
1115WantedBy =multi-user.target
Original file line number Diff line number Diff line change 11%define _trivial .0
2- %define _buildid .2
2+ %define _buildid .3
33Name: update-motd
44Version: 2.0
55Release: 1%{?dist }%{?_trivial }%{?_buildid }
@@ -13,7 +13,7 @@ BuildRequires: systemd-devel
1313%{?systemd_requires }
1414
1515Source0: sbin_update-motd
16- Source1: cron_update -motd
16+ Source1: update -motd.timer
1717Source2: update-motd.service
1818
1919%description
@@ -24,7 +24,7 @@ Based on and compatible with the framework implemented Ubuntu.
2424rm -rf %{buildroot }
2525install -d %{buildroot }/etc/update-motd.d
2626install -D -m 0755 %{SOURCE0 } %{buildroot }/usr/sbin/update-motd
27- install -D -m 0644 %{SOURCE1 } %{buildroot }/etc/cron.d/ update-motd
27+ install -D -m 0644 %{SOURCE1 } %{buildroot }%{ _unitdir }/ update-motd.timer
2828install -D -m 0644 %{SOURCE2 } %{buildroot }%{_unitdir }/update-motd.service
2929# for %ghost
3030install -d %{buildroot }/var/lib/update-motd
6262%defattr(-,root,root,-)
6363%dir /etc/update-motd.d
6464%dir /var/lib/update-motd
65- %config /etc/cron.d/update-motd
66- %config %{_unitdir }/update-motd.service
65+ %config %{_unitdir }/update-motd.{service,timer}
6766/usr/sbin/update-motd
6867%ghost /var/lib/update-motd/motd
6968
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description=Timer for Dynamically Generate Message Of The Day
3+
4+ [Timer]
5+ OnUnitActiveSec=720min
6+ RandomizedDelaySec=720min
7+ FixedRandomDelay=true
8+ Persistent=true
9+
10+ [Install]
11+ WantedBy=timers.target
You can’t perform that action at this time.
0 commit comments