From: Stefan Schantl Date: Thu, 29 Sep 2011 20:26:13 +0000 (+0200) Subject: systemd: Add scriptlet. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d40b321dd2452bed6aa153df12f87d877b0275a;p=ipfire-3.x.git systemd: Add scriptlet. --- diff --git a/systemd/systemd.nm b/systemd/systemd.nm index 1af5065e5..1ffaf3b8c 100644 --- a/systemd/systemd.nm +++ b/systemd/systemd.nm @@ -5,7 +5,7 @@ name = systemd version = 33 -release = 2 +release = 3 maintainer = Stefan Schantl 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