aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--Makefile15
-rw-r--r--initscripts.spec24
-rw-r--r--systemd/system/rhel-autorelabel-mark.service5
-rw-r--r--systemd/system/rhel-autorelabel.service5
-rw-r--r--systemd/system/rhel-configure.service5
-rw-r--r--systemd/system/rhel-domainname.service4
-rw-r--r--systemd/system/rhel-import-state.service7
-rw-r--r--systemd/system/rhel-loadmodules.service5
-rw-r--r--systemd/system/rhel-readonly.service5
9 files changed, 40 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index ffdabee3..ee46d1e0 100644
--- a/Makefile
+++ b/Makefile
@@ -84,21 +84,6 @@ install:
chmod u=rwx,g=rx,o=rx $$dir; \
done
-# Can't store symlinks in a CVS archive
- mkdir -p -m 755 $(ROOT)/usr/lib/systemd/system/multi-user.target.wants
- mkdir -p -m 755 $(ROOT)/usr/lib/systemd/system/graphical.target.wants
- mkdir -p -m 755 $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
- mkdir -p -m 755 $(ROOT)/usr/lib/systemd/system/basic.target.wants
- mkdir -p -m 755 $(ROOT)/usr/lib/systemd/system/sysinit.target.wants
- ln -s ../rhel-configure.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../rhel-loadmodules.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../rhel-autorelabel.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../rhel-autorelabel-mark.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../rhel-dmesg.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../rhel-readonly.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
- ln -s ../rhel-import-state.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
- ln -s ../brandbot.path $(ROOT)/usr/lib/systemd/system/multi-user.target.wants
-
mkdir -p $(ROOT)/usr/lib/tmpfiles.d
install -m 644 initscripts.tmpfiles.d $(ROOT)/usr/lib/tmpfiles.d/initscripts.conf
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
diff --git a/systemd/system/rhel-autorelabel-mark.service b/systemd/system/rhel-autorelabel-mark.service
index 33b5147b..9a7fb878 100644
--- a/systemd/system/rhel-autorelabel-mark.service
+++ b/systemd/system/rhel-autorelabel-mark.service
@@ -10,6 +10,9 @@ ConditionPathIsDirectory=/etc/selinux
ConditionPathExists=!/.autorelabel
[Service]
-ExecStart=-/bin/touch /.autorelabel
+ExecStart=-/usr/bin/touch /.autorelabel
Type=oneshot
RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/rhel-autorelabel.service b/systemd/system/rhel-autorelabel.service
index d277cf86..0f11c52e 100644
--- a/systemd/system/rhel-autorelabel.service
+++ b/systemd/system/rhel-autorelabel.service
@@ -10,8 +10,11 @@ ConditionKernelCommandLine=|autorelabel
ConditionPathExists=|/.autorelabel
[Service]
-ExecStart=/lib/systemd/rhel-autorelabel
+ExecStart=/usr/lib/systemd/rhel-autorelabel
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
StandardInput=tty
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/rhel-configure.service b/systemd/system/rhel-configure.service
index 7ee34ceb..68fbe788 100644
--- a/systemd/system/rhel-configure.service
+++ b/systemd/system/rhel-configure.service
@@ -7,9 +7,12 @@ After=local-fs.target
ConditionPathExists=/.unconfigured
[Service]
-ExecStart=/lib/systemd/rhel-configure
+ExecStart=/usr/lib/systemd/rhel-configure
ExecStopPost=/bin/rm -f /.unconfigured
Type=oneshot
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/system/rhel-domainname.service b/systemd/system/rhel-domainname.service
index e4deb8c1..633693a5 100644
--- a/systemd/system/rhel-domainname.service
+++ b/systemd/system/rhel-domainname.service
@@ -1,11 +1,11 @@
[Unit]
Description=Read and set NIS domainname from /etc/sysconfig/network
-Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service
+Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service sysinit.target
DefaultDependencies=no
Conflicts=shutdown.target
[Service]
-ExecStart=/lib/systemd/rhel-domainname
+ExecStart=/usr/lib/systemd/rhel-domainname
Type=oneshot
RemainAfterExit=yes
diff --git a/systemd/system/rhel-import-state.service b/systemd/system/rhel-import-state.service
index 182b0f99..d4b78a7f 100644
--- a/systemd/system/rhel-import-state.service
+++ b/systemd/system/rhel-import-state.service
@@ -4,11 +4,14 @@ DefaultDependencies=no
ConditionPathIsReadWrite=/
ConditionDirectoryNotEmpty=/run/initramfs/state
Conflicts=shutdown.target
-Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service basic.target
+Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service sysinit.target
After=local-fs.target
[Service]
-ExecStart=/lib/systemd/rhel-import-state
+ExecStart=/usr/lib/systemd/rhel-import-state
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/rhel-loadmodules.service b/systemd/system/rhel-loadmodules.service
index a834e042..746b3c27 100644
--- a/systemd/system/rhel-loadmodules.service
+++ b/systemd/system/rhel-loadmodules.service
@@ -8,7 +8,10 @@ ConditionPathExists=|/etc/rc.modules
ConditionDirectoryNotEmpty=|/etc/sysconfig/modules/
[Service]
-ExecStart=/lib/systemd/rhel-loadmodules
+ExecStart=/usr/lib/systemd/rhel-loadmodules
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/rhel-readonly.service b/systemd/system/rhel-readonly.service
index 3ee1895d..c89edf81 100644
--- a/systemd/system/rhel-readonly.service
+++ b/systemd/system/rhel-readonly.service
@@ -6,7 +6,10 @@ Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup
After=systemd-remount-fs.service
[Service]
-ExecStart=/lib/systemd/rhel-readonly
+ExecStart=/usr/lib/systemd/rhel-readonly
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=local-fs.target