From 0d250492b5ce1f01040898da7eba7db5df4f07be Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 26 Feb 2016 23:31:31 +0100 Subject: drop shell script and implement with systemd units --- systemd/ykfde-notify.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 systemd/ykfde-notify.service (limited to 'systemd/ykfde-notify.service') diff --git a/systemd/ykfde-notify.service b/systemd/ykfde-notify.service new file mode 100644 index 0000000..e77f634 --- /dev/null +++ b/systemd/ykfde-notify.service @@ -0,0 +1,18 @@ +# (C) 2016 by Christian Hesse +# +# This software may be used and distributed according to the terms +# of the GNU General Public License, incorporated herein by reference. + +[Unit] +Description=Notify ykfde about key +DefaultDependencies=no +Before=cryptsetup-pre.target +Wants=cryptsetup-pre.target +Requires=ykfde-2f.service +ConditionPathExists=/run/ykfde.pid + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/pkill -USR1 --pidfile /run/ykfde.pid +ExecStart=/usr/bin/sleep 0.2 -- cgit v1.2.3-70-g09d2 From 4ee8fd45b82298b5de86e617c449fe53fd45ff84 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 26 Feb 2016 23:34:47 +0100 Subject: fix start order of units --- systemd/ykfde-notify.service | 1 + 1 file changed, 1 insertion(+) (limited to 'systemd/ykfde-notify.service') diff --git a/systemd/ykfde-notify.service b/systemd/ykfde-notify.service index e77f634..b2ddc72 100644 --- a/systemd/ykfde-notify.service +++ b/systemd/ykfde-notify.service @@ -9,6 +9,7 @@ DefaultDependencies=no Before=cryptsetup-pre.target Wants=cryptsetup-pre.target Requires=ykfde-2f.service +After=ykfde-2f.service ConditionPathExists=/run/ykfde.pid [Service] -- cgit v1.2.3-70-g09d2 From a264487008bbf0f3a47f2e57e1c1ec4472d18653 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 2 Mar 2016 22:06:24 +0100 Subject: add comment about sleep Is there any better way than sleeping? --- systemd/ykfde-notify.service | 3 +++ 1 file changed, 3 insertions(+) (limited to 'systemd/ykfde-notify.service') diff --git a/systemd/ykfde-notify.service b/systemd/ykfde-notify.service index b2ddc72..04a4d46 100644 --- a/systemd/ykfde-notify.service +++ b/systemd/ykfde-notify.service @@ -16,4 +16,7 @@ ConditionPathExists=/run/ykfde.pid Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/pkill -USR1 --pidfile /run/ykfde.pid +# ykfde started from udev needs a moment to set up the key +# in store. It is out of systemd control, so wait a moment +# here. ExecStart=/usr/bin/sleep 0.2 -- cgit v1.2.3-70-g09d2