@mmstick76, while I agree with the grumblings upstream that udev should
be better about race conditions like this, if we're working around it
I'd prefer to flock while mkswap instead of retriggering udev...can you
test with that change?

Patch below, and I have test builds for b/f here:
https://launchpad.net/~ddstreet/+archive/ubuntu/lp1838329


--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -202,8 +202,8 @@ static int create_disk(
 
         if (swap)
                 fprintf(f,
-                        "ExecStartPost=/sbin/mkswap '/dev/mapper/%s'\n",
-                        name_escaped);
+                        "ExecStartPost=/usr/bin/flock -F '/dev/mapper/%s' 
/sbin/mkswap '/dev/mapper/%s'\n",
+                        name_escaped, name_escaped);
 
         r = fflush_and_check(f);
         if (r < 0)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1838329

Title:
  Cryptswap periodically fails to mount at boot due to missing a udev
  notification

To manage notifications about this bug go to:
https://bugs.launchpad.net/systemd/+bug/1838329/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to