aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2017-10-17 13:20:37 +0200
committerDee'Kej <deekej@linuxmail.org>2017-10-19 11:22:19 +0200
commit5829c811dd082ac046846bb932d9d14fbc777c17 (patch)
treed6856ba11b5995ca15d5a0c2e21407701dc7d706
parentc9c00e84a9a8bfb47271c1295d34c812676a0912 (diff)
downloadinitscripts-5829c811dd082ac046846bb932d9d14fbc777c17.tar
initscripts-5829c811dd082ac046846bb932d9d14fbc777c17.tar.gz
initscripts-5829c811dd082ac046846bb932d9d14fbc777c17.tar.bz2
initscripts-5829c811dd082ac046846bb932d9d14fbc777c17.tar.xz
initscripts-5829c811dd082ac046846bb932d9d14fbc777c17.zip
systemd/system: symlinks for fedora-* services removed
The symlinks are no longer needed. Enablement of default services is now managed by 'fedora-release' package.
-rw-r--r--Makefile9
-rw-r--r--initscripts.spec17
-rw-r--r--systemd/system/fedora-domainname.service4
-rw-r--r--systemd/system/fedora-import-state.service7
-rw-r--r--systemd/system/fedora-loadmodules.service5
-rw-r--r--systemd/system/fedora-readonly.service5
6 files changed, 27 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index ba94984f..ae3955ad 100644
--- a/Makefile
+++ b/Makefile
@@ -64,15 +64,6 @@ install:
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 ../fedora-loadmodules.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
- ln -s ../fedora-readonly.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
- ln -s ../fedora-import-state.service $(ROOT)/usr/lib/systemd/system/local-fs.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 00584e18..7d637979 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -29,6 +29,7 @@ Conflicts: ppp < 2.4.6-4
Requires(pre): /usr/sbin/groupadd
Requires(post): /sbin/chkconfig, coreutils
Requires(preun): /sbin/chkconfig
+%{?systemd_requires}
BuildRequires: glib2-devel popt-devel gettext pkgconfig systemd
Provides: /sbin/service
@@ -57,21 +58,27 @@ touch %{buildroot}%{_sysconfdir}/rc.d/rc.local
chmod 755 %{buildroot}%{_sysconfdir}/rc.d/rc.local
%post
+%systemd_post fedora-import-state.service fedora-loadmodules.service fedora-readonly.service
+
/usr/sbin/chkconfig --add network > /dev/null 2>&1 || :
/usr/sbin/chkconfig --add netconsole > /dev/null 2>&1 || :
-if [ $1 -eq 1 ]; then
- /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
-fi
%preun
+%systemd_preun fedora-import-state.service fedora-loadmodules.service fedora-readonly.service
+
if [ $1 = 0 ]; then
/usr/sbin/chkconfig --del network > /dev/null 2>&1 || :
/usr/sbin/chkconfig --del netconsole > /dev/null 2>&1 || :
fi
%postun
-if [ $1 -ge 1 ]; then
- /usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
+%systemd_postun fedora-import-state.service fedora-loadmodules.service fedora-readonly.service
+
+# This should be removed in Rawhide for Fedora 29:
+%triggerun -- initscripts < 9.78
+if [ $1 -gt 1 ]; then
+ systemctl enable fedora-import-state.service fedora-readonly.service &> /dev/null || :
+ echo -e "\nUPGRADE: Automatically re-enabling default systemd units: fedora-import-state.service fedora-readonly.service\n" || :
fi
%files -f %{name}.lang
diff --git a/systemd/system/fedora-domainname.service b/systemd/system/fedora-domainname.service
index d5e0ff54..b62e52b1 100644
--- a/systemd/system/fedora-domainname.service
+++ b/systemd/system/fedora-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/fedora-domainname
+ExecStart=/usr/lib/systemd/fedora-domainname
Type=oneshot
RemainAfterExit=yes
diff --git a/systemd/system/fedora-import-state.service b/systemd/system/fedora-import-state.service
index e1aa0454..b43ac29f 100644
--- a/systemd/system/fedora-import-state.service
+++ b/systemd/system/fedora-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/fedora-import-state
+ExecStart=/usr/lib/systemd/fedora-import-state
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/fedora-loadmodules.service b/systemd/system/fedora-loadmodules.service
index 51285093..641e7711 100644
--- a/systemd/system/fedora-loadmodules.service
+++ b/systemd/system/fedora-loadmodules.service
@@ -7,7 +7,10 @@ ConditionPathExists=|/etc/rc.modules
ConditionDirectoryNotEmpty=|/etc/sysconfig/modules/
[Service]
-ExecStart=/lib/systemd/fedora-loadmodules
+ExecStart=/usr/lib/systemd/fedora-loadmodules
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/systemd/system/fedora-readonly.service b/systemd/system/fedora-readonly.service
index 7a079445..30530219 100644
--- a/systemd/system/fedora-readonly.service
+++ b/systemd/system/fedora-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/fedora-readonly
+ExecStart=/usr/lib/systemd/fedora-readonly
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes
+
+[Install]
+WantedBy=local-fs.target