From 462068f247b0073aeb7b1866529e3cbba299e612 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 20 Jun 2017 18:23:52 +0200 Subject: Rework the code, update keyring handling This had some historical issue... So rework the code: * split into more functions * drop the sleep and notify logic * update keyring handling Depending on setup and systemd version (233 and up) the keyring handling fails. Try to fix this by... * writing to session keyring first * setting permissions * linking to user keyring * unlinking from session keyring https://mjg59.dreamwidth.org/37333.html --- systemd/ykfde-notify.service | 22 ---------------------- systemd/ykfde-worker.service | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 systemd/ykfde-notify.service create mode 100644 systemd/ykfde-worker.service (limited to 'systemd') diff --git a/systemd/ykfde-notify.service b/systemd/ykfde-notify.service deleted file mode 100644 index c3a8d21..0000000 --- a/systemd/ykfde-notify.service +++ /dev/null @@ -1,22 +0,0 @@ -# (C) 2016-2017 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 -After=ykfde-2f.service -ConditionPathExists=/run/ykfde.pid - -[Service] -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 diff --git a/systemd/ykfde-worker.service b/systemd/ykfde-worker.service new file mode 100644 index 0000000..6f5a18f --- /dev/null +++ b/systemd/ykfde-worker.service @@ -0,0 +1,16 @@ +# (C) 2016-2017 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=Run ykfde worker +DefaultDependencies=no +Before=cryptsetup-pre.target +Wants=cryptsetup-pre.target +Requires=ykfde-2f.service +After=ykfde-2f.service + +[Service] +Type=oneshot +ExecStart=/usr/lib/udev/ykfde -- cgit v1.2.3-70-g09d2