@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)
@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: /launchpad. net/~ddstreet/ +archive/ ubuntu/ lp1838329
https:/
--- a/src/cryptsetu p/cryptsetup- generator. c p/cryptsetup- generator. c
+++ b/src/cryptsetu
@@ -202,8 +202,8 @@ static int create_disk(
if (swap)
fprintf( f, /sbin/mkswap '/dev/mapper/ %s'\n", /usr/bin/ flock -F '/dev/mapper/%s' /sbin/mkswap '/dev/mapper/ %s'\n",
- "ExecStartPost=
- name_escaped);
+ "ExecStartPost=
+ name_escaped, name_escaped);
r = fflush_ and_check( f);
if (r < 0)