[systemd/f14/master] Properly create default.target link

Lennart Poettering lennart at fedoraproject.org
Thu Aug 26 16:17:54 UTC 2010


commit d007df0365cea3d21af432dd4a227fb4c990c506
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Aug 26 18:16:18 2010 +0200

    Properly create default.target link

 systemd.spec |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/systemd.spec b/systemd.spec
index 9fbf387..7dd2789 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -2,7 +2,7 @@ Name:           systemd
 Url:            http://www.freedesktop.org/wiki/Software/systemd
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Version:        8
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        GPLv2+
 Group:          System Environment/Base
 Summary:        A System and Session Manager
@@ -109,6 +109,12 @@ rm %{buildroot}/etc/systemd/system/default.target
 sed -i -e 's/^#MountAuto=yes$/MountAuto=no/' \
         -e 's/^#SwapAuto=yes$/SwapAuto=no/' %{buildroot}/etc/systemd/system.conf
 
+# Make sure the %ghost-ing below works
+touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel2.target
+touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel3.target
+touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel4.target
+touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel5.target
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -119,7 +125,7 @@ if [ $1 -eq 1 ] ; then
         if [ -z "$runlevel" ] ; then
                 target="/lib/systemd/system/graphical.target"
         else
-                target="/etc/systemd/system/runlevel$runlevel.target"
+                target="/lib/systemd/system/runlevel$runlevel.target"
         fi
 
         # And symlink what we found to the new-style default.target
@@ -200,6 +206,13 @@ fi
 %{_datadir}/pkgconfig/systemd.pc
 %{_docdir}/systemd/LICENSE
 
+# Make sure we don't remove runlevel targets from F14 alpha installs,
+# but make sure we don't create then anew.
+%ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel2.target
+%ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel3.target
+%ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel4.target
+%ghost %config(noreplace) %{_sysconfdir}/systemd/system/runlevel5.target
+
 %files gtk
 %defattr(-,root,root,-)
 %{_bindir}/systemadm
@@ -223,6 +236,9 @@ fi
 %{_mandir}/man8/runlevel.*
 
 %changelog
+* Thu Aug 26 2010 Lennart Poettering <lpoetter at redhat.com> - 8-2
+- Properly create default.target link
+
 * Wed Aug 25 2010 Lennart Poettering <lpoetter at redhat.com> - 8-1
 - New upstream release
 


More information about the scm-commits mailing list