923a60
From f77d58374ccd2e3d9c886e59020f1b32e97f2bdc Mon Sep 17 00:00:00 2001
923a60
From: Michal Sekletar <msekletar@users.noreply.github.com>
923a60
Date: Mon, 29 Aug 2016 14:49:20 +0200
923a60
Subject: [PATCH] units: remove udev control socket when systemd stops the
923a60
 socket unit (#49)
923a60
923a60
Mere presence of the socket in the filesystem makes
923a60
udev_queue_get_udev_is_active() return that udev is running. Note that,
923a60
udev on exit doesn't unlink control socket nor does systemd. Thus socket
923a60
stays around even when both daemon and socket are stopped. This causes
923a60
problems for cryptsetup because when it detects running udev it launches
923a60
synchronous operations that *really* require udev. This in turn may
923a60
cause blocking and subsequent timeout in systemd-cryptsetup on reboot
923a60
while machine is in a state that udev and its control socket units are
923a60
stopped, e.g. emergency mode.
923a60
923a60
Fixes #2477
923a60
923a60
Cherry-picked from: a2de10775194edec51b1e88d20a380724a3dc716
923a60
Resolves: #1370133
923a60
---
923a60
 units/systemd-udevd-control.socket | 1 +
923a60
 1 file changed, 1 insertion(+)
923a60
923a60
diff --git a/units/systemd-udevd-control.socket b/units/systemd-udevd-control.socket
923a60
index 8330a1c035..46f704ed79 100644
923a60
--- a/units/systemd-udevd-control.socket
923a60
+++ b/units/systemd-udevd-control.socket
923a60
@@ -17,3 +17,4 @@ Service=systemd-udevd.service
923a60
 ListenSequentialPacket=/run/udev/control
923a60
 SocketMode=0600
923a60
 PassCredentials=yes
923a60
+RemoveOnStop=yes