]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
systemd/dracut-cmdline: make dracut-cmdline a service
authorHarald Hoyer <harald@redhat.com>
Wed, 20 Jun 2012 23:05:15 +0000 (01:05 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 20 Jun 2012 23:11:44 +0000 (01:11 +0200)
convert dracut-cmdline from hook to service after the journal

modules.d/98systemd/dracut-cmdline.service [new file with mode: 0644]
modules.d/98systemd/module-setup.sh

diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service
new file mode 100644 (file)
index 0000000..938ccbe
--- /dev/null
@@ -0,0 +1,29 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+# See systemd.special(7) for details
+
+[Unit]
+Description=Dracut cmdline hook
+DefaultDependencies=no
+Before=dracut-pre-udev.service
+After=systemd-journald.socket
+Wants=systemd-journald.socket
+
+[Service]
+Environment=HOME=/
+WorkingDirectory=/
+ExecStart=-/bin/dracut-cmdline
+Type=oneshot
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
+KillMode=process
+
+# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
+# terminates cleanly.
+KillSignal=SIGHUP
index 91f50af8d66f6156f94b69724924685f6181d67b..adef9392cecdf9a0e607bf94f7f203b4e0fd0de2 100755 (executable)
@@ -130,9 +130,12 @@ install() {
     inst "$moddir/initrd-switch-root.service" ${systemdsystemunitdir}/initrd-switch-root.service
     ln -s basic.target "${initdir}${systemdsystemunitdir}/default.target"
 
-    inst "$moddir/dracut-cmdline.sh" ${systemdsystemunitdir}-generators/dracut-cmdline.sh
-
     mkdir -p "${initdir}${systemdsystemunitdir}/basic.target.wants"
+
+    inst "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
+    inst "$moddir/dracut-cmdline.service" ${systemdsystemunitdir}/dracut-cmdline.service
+    ln -s ../dracut-cmdline.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-cmdline.service"
+
     inst "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
     inst "$moddir/dracut-pre-udev.service" ${systemdsystemunitdir}/dracut-pre-udev.service
     ln -s ../dracut-pre-udev.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-udev.service"