]> git.pld-linux.org Git - packages/systemd.git/commitdiff
Added preset config
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 20 Aug 2012 09:39:37 +0000 (11:39 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 20 Aug 2012 09:39:37 +0000 (11:39 +0200)
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 [new file with mode: 0644]
systemd.spec

diff --git a/default.preset b/default.preset
new file mode 100644 (file)
index 0000000..695c952
--- /dev/null
@@ -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
index eae04753d05b82333902d59ef89149357169b175..0017d75d9e89f2f824f54d4ea3fe948a564db848 100644 (file)
@@ -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
This page took 0.040145 seconds and 4 git commands to generate.