aboutsummaryrefslogtreecommitdiffstats
path: root/initscripts.spec
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2017-10-19 12:13:45 +0200
committerDee'Kej <deekej@linuxmail.org>2017-10-31 12:39:18 +0100
commit995e8ad74f5a6bc51f28c0be4ed02c547e0891d6 (patch)
tree74fc4a79f5597227a811d7001dc17b416fc6423c /initscripts.spec
parentc200aed368884f278bd6c9e43050fa812439c0e4 (diff)
downloadinitscripts-995e8ad74f5a6bc51f28c0be4ed02c547e0891d6.tar
initscripts-995e8ad74f5a6bc51f28c0be4ed02c547e0891d6.tar.gz
initscripts-995e8ad74f5a6bc51f28c0be4ed02c547e0891d6.tar.bz2
initscripts-995e8ad74f5a6bc51f28c0be4ed02c547e0891d6.tar.xz
initscripts-995e8ad74f5a6bc51f28c0be4ed02c547e0891d6.zip
systemd/system: symlinks for initscripts' services removed
The symlinks are no longer needed. Enablement of default services is now managed by 'redhat-release' package. Resolves: #1395391 Resolves: #1357648
Diffstat (limited to 'initscripts.spec')
-rw-r--r--initscripts.spec24
1 files changed, 13 insertions, 11 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 6b81095a..9e8a4230 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -32,7 +32,8 @@ Conflicts: NetworkManager < 0.9.9.0-37.git20140131.el7
Requires(pre): /usr/sbin/groupadd
Requires(post): /sbin/chkconfig, coreutils
Requires(preun): /sbin/chkconfig
-BuildRequires: glib2-devel popt-devel gettext pkgconfig
+%{?systemd_requires}
+BuildRequires: glib2-devel popt-devel gettext pkgconfig systemd
Provides: /sbin/service
%description
@@ -78,6 +79,8 @@ chmod 600 $RPM_BUILD_ROOT/etc/crypttab
/usr/sbin/groupadd -g 22 -r -f utmp
%post
+%systemd_post brandbot.path rhel-autorelabel.service rhel-autorelabel-mark.service rhel-configure.service rhel-dmesg.service rhel-domainname.service rhel-import-state.service rhel-loadmodules.service rhel-readonly.service
+
touch /var/log/wtmp /var/run/utmp /var/log/btmp
chown root:utmp /var/log/wtmp /var/run/utmp /var/log/btmp
chmod 664 /var/log/wtmp /var/run/utmp
@@ -85,24 +88,23 @@ chmod 600 /var/log/btmp
/usr/sbin/chkconfig --add network
/usr/sbin/chkconfig --add netconsole
-if [ $1 -eq 1 ]; then
- /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
-fi
%preun
+%systemd_preun brandbot.path rhel-autorelabel.service rhel-autorelabel-mark.service rhel-configure.service rhel-dmesg.service rhel-domainname.service rhel-import-state.service rhel-loadmodules.service rhel-readonly.service
+
if [ $1 = 0 ]; then
/usr/sbin/chkconfig --del network
/usr/sbin/chkconfig --del netconsole
fi
-%triggerun -- initscripts < 7.62
-/usr/sbin/chkconfig --del random
-/usr/sbin/chkconfig --del rawdevices
-exit 0
-
%postun
-if [ $1 -ge 1 ]; then
- /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
+%systemd_postun brandbot.path rhel-autorelabel.service rhel-autorelabel-mark.service rhel-configure.service rhel-dmesg.service rhel-domainname.service rhel-import-state.service rhel-loadmodules.service rhel-readonly.service
+
+# We need to keep this in initscripts until the EOL of RHEL-7.2-EUS:
+%triggerun -- initscripts < 9.49.40
+if [ $1 -gt 1 ]; then
+ systemctl enable brandbot.path rhel-autorelabel.service rhel-autorelabel-mark.service rhel-configure.service rhel-dmesg.service rhel-domainname.service rhel-import-state.service rhel-loadmodules.service rhel-readonly.service &> /dev/null || :
+ echo -e "\nUPGRADE: Automatically re-enabling default systemd units:\n\tbrandbot.path\n\trhel-autorelabel.service\n\trhel-autorelabel-mark.service\n\trhel-configure.service\n\trhel-dmesg.service\n\trhel-domainname.service\n\trhel-import-state.service\n\trhel-loadmodules.service\n\trhel-readonly.service\n" || :
fi
%clean