Skip to content

Commit c0f8d0b

Browse files
author
Jason Green
committed
Update for systemd
1 parent f78ccea commit c0f8d0b

10 files changed

+25
-35
lines changed
File renamed without changes.

Makefile

Lines changed: 0 additions & 25 deletions
This file was deleted.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Delay a random time between 0 and 360 minutes (6 hours) to avoid having all
22
# instances update at the same time.
33
RANDOM_DELAY=360
4-
@daily root /sbin/start --quiet update-motd
4+
@daily root /usr/bin/systemctl --quiet restart update-motd
File renamed without changes.

SOURCES/update-motd.service

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Dynamically Generate Message Of The Day
3+
After=network-online.target
4+
5+
[Service]
6+
Type=oneshot
7+
ExecStart=/usr/sbin/update-motd
8+
RemainAfterExit=yes
9+
10+
[Install]
11+
WantedBy=multi-user.target
File renamed without changes.
File renamed without changes.

srpm/update-motd.spec renamed to SPECS/update-motd.spec

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ Group: System Environment/Base
77
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
88
BuildArch: noarch
99
Requires: bash coreutils
10-
Requires: upstart
10+
BuildRequires: systemd-devel
11+
%{?systemd_requires}
1112

1213
Source0: sbin_update-motd
1314
Source1: cron_update-motd
14-
Source2: upstart_update-motd.conf
15+
Source2: update-motd.service
1516
Source3: yum_update-motd.py
1617
Source4: yum_update-motd.conf
1718

@@ -24,7 +25,7 @@ rm -rf %{buildroot}
2425
install -d %{buildroot}/etc/update-motd.d
2526
install -D -m 0755 %{SOURCE0} %{buildroot}/usr/sbin/update-motd
2627
install -D -m 0644 %{SOURCE1} %{buildroot}/etc/cron.d/update-motd
27-
install -D -m 0644 %{SOURCE2} %{buildroot}/etc/init/update-motd.conf
28+
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/update-motd.service
2829
install -D -m 0644 %{SOURCE3} %{buildroot}/usr/lib/yum-plugins/update-motd.py
2930
install -D -m 0644 %{SOURCE4} %{buildroot}/etc/yum/pluginconf.d/update-motd.conf
3031
# for %ghost
@@ -51,16 +52,21 @@ elif [ "$1" = "2" ]; then
5152
ln -snf /var/lib/update-motd/motd /etc/motd
5253
fi
5354
fi
54-
# We don't run update-motd on install because the various update-motd.d scripts
55-
# are not installed yet (since their packages will depend on this one).
56-
# This could also be the case in an upgrade situation, so we leave it to cron.
55+
%systemd_post update-motd.service sshd.socket
56+
57+
%preun
58+
%systemd_preun update-motd.service sshd.socket
59+
60+
%postun
61+
%systemd_postun_with_restart update-motd.service
62+
5763

5864
%files
5965
%defattr(-,root,root,-)
6066
%dir /etc/update-motd.d
6167
%dir /var/lib/update-motd
6268
%config /etc/cron.d/update-motd
63-
%config /etc/init/update-motd.conf
69+
%config %{_unitdir}/update-motd.service
6470
%config /etc/yum/pluginconf.d/update-motd.conf
6571
/usr/sbin/update-motd
6672
/usr/lib/yum-plugins/update-motd.py*

srpm/upstart_update-motd.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)