]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
systemd: Add scriptlet.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 29 Sep 2011 20:26:13 +0000 (22:26 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 29 Sep 2011 20:31:22 +0000 (22:31 +0200)
systemd/systemd.nm

index 1af5065e53bd998267f541db0c25e009dea028d7..1ffaf3b8c71793aba962b2ebb76f22420e22b06a 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = systemd
 version    = 33
-release    = 2
+release    = 3
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = System/Base
@@ -109,9 +109,31 @@ packages
                requires
                        dbus
                        python-cairo
-                       python-dbus udev>=172
+                       python-dbus
+                       udev>=172
                        util-linux>=2.19
                end
+
+               script postin
+                       # Generate Machine ID.
+                       /bin/systemd-machine-id-setup > /dev/null 2>&1 || :
+
+                       # Reexec systemd daemon.
+                       /bin/systemctl daemon-reexec > /dev/null 2>&1 || :
+
+                       # Make sure pam_systemd is enabled
+                       if ! /bin/grep -q pam_systemd /etc/pam.d/system-auth-ac ; then
+                               /usr/sbin/authconfig --update --nostart >/dev/null 2>&1 || :
+
+                               # Try harder
+                               /bin/grep -q pam_systemd /etc/pam.d/system-auth-ac || /usr/sbin/authconfig --updateall --nostart >/dev/null 2>&1 || :
+                       fi
+               end
+
+               script postup
+                       # Restart login service after update
+                       /bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
+               end
        end
        
        # Package information for systemd-units
@@ -131,6 +153,25 @@ packages
                        /bin/systemd-tmpfiles
                        /usr/share/man/man1/systemctl.*
                end
+
+               script postin
+                       # Enable default services.
+                       systemctl enable \
+                               getty@.service \
+                               remote-fs.target > /dev/null 2>&1 || :
+               end
+
+               script preun
+                       # Disable default services.
+                       systemctl disable \
+                               getty@.service \
+                               remote-fs.target > /dev/null 2>&1 || :
+               end
+
+               script postup
+                       # Reload service files
+                       systemctl daemon-reload > /dev/null 2>&1 || :
+               end
        end
        
        package %{name}-devel