[packages/systemd] Added preset config

baggins baggins at pld-linux.org
Mon Aug 20 11:42:07 CEST 2012


commit a98a12d92902ff991ecccf8c1c172818a26fa8c0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Aug 20 11:39:37 2012 +0200

    Added preset config
    
    Systemd can enable/disable services based on preset configuration,
    replace rpm config option RPM_ENABLE_SYSTEMD_SERVICE with native systemd
    preset configuration in preparation to replace our rpm macros with those
    provided by systemd.

 default.preset |  3 +++
 systemd.spec   | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/systemd.spec b/systemd.spec
index eae0475..0017d75 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -39,7 +39,7 @@ Summary(pl.UTF-8):	systemd - zarządca systemu i usług dla Linuksa
 Name:		systemd
 # Verify ChangeLog and NEWS when updating (since there are incompatible/breaking changes very often)
 Version:	187
-Release:	2
+Release:	3
 Epoch:		1
 License:	GPL v2+
 Group:		Base
@@ -58,6 +58,7 @@ Source14:	pld-clean-tmp.service
 Source15:	pld-clean-tmp.sh
 Source16:	pld-rc-inetd-generator.sh
 Source17:	rc-inetd.service
+Source18:	default.preset
 # rules
 Source101:	udev-alsa.rules
 Source102:	udev.rules
@@ -655,7 +656,7 @@ patch -p1 -R <%{PATCH100}
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/var/lib/%{name}/coredump \
-	$RPM_BUILD_ROOT{%{_sysconfdir}/modprobe.d,%{_sbindir}}
+	$RPM_BUILD_ROOT{%{_sysconfdir}/{modprobe.d,systemd/system-preset},%{_sbindir}}
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
@@ -756,6 +757,8 @@ ln -s ../pld-clean-tmp.service $RPM_BUILD_ROOT%{systemdunitdir}/local-fs.target.
 cp -p %{SOURCE16} $RPM_BUILD_ROOT/lib/systemd/system-generators/pld-rc-inetd-generator
 cp -p %{SOURCE17} $RPM_BUILD_ROOT%{systemdunitdir}/rc-inetd.service
 
+cp -p %{SOURCE18} $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system-preset/default.preset
+
 # handled by rc-local sysv service, no need for generator
 %{__rm} $RPM_BUILD_ROOT/lib/systemd/system-generators/systemd-rc-local-generator
 
@@ -863,6 +866,14 @@ if [ -f /etc/systemd/systemd-logind.conf.rpmsave ]; then
 	%{__mv} -f /etc/systemd/systemd-logind.conf.rpmsave /etc/systemd/logind.conf
 fi
 
+%triggerpostun units -- systemd-units < 1:187-3
+if [ -f /etc/sysconfig/rpm ]; then
+	. /etc/sysconfig/rpm
+	if [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ]; then
+		echo "disable *" >>%{_sysconfdir}/systemd/system-preset/default.preset
+	fi
+fi
+
 %post inetd
 %systemd_reload
 # Do not change it to restart, we only want to start new services here
@@ -1107,6 +1118,8 @@ fi
 %dir %{_sysconfdir}/sysctl.d
 %dir %{_sysconfdir}/systemd
 %dir %{_sysconfdir}/systemd/system
+%dir %{_sysconfdir}/systemd/system-preset
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/systemd/system-preset/default.preset
 %dir %{_sysconfdir}/tmpfiles.d
 %dir %{_libexecdir}/binfmt.d
 %dir %{_libexecdir}/modules-load.d
diff --git a/default.preset b/default.preset
new file mode 100644
index 0000000..695c952
--- /dev/null
+++ b/default.preset
@@ -0,0 +1,3 @@
+# Policy about what services shall be enabled and what services shall not.
+# Default is to enable (via `systemctl preset`) all units that are installed.
+# See systemd.preset for more information


More information about the pld-cvs-commit mailing list