diff -Nru drbd-utils-8.9.10/debian/changelog drbd-utils-8.9.10/debian/changelog --- drbd-utils-8.9.10/debian/changelog 2017-05-12 08:05:39.000000000 -0400 +++ drbd-utils-8.9.10/debian/changelog 2018-05-25 11:17:50.000000000 -0400 @@ -1,3 +1,10 @@ +drbd-utils (8.9.10-2ubuntu1) cosmic; urgency=medium + + * Fix creation of drbd symlinks with newer udev. + (LP: #1673255) + + -- Dan Streetman Fri, 25 May 2018 11:17:50 -0400 + drbd-utils (8.9.10-2) unstable; urgency=medium * Fix the service enable/disable logic (broken since 8.9.8-1, closes: diff -Nru drbd-utils-8.9.10/debian/patches/fix-nonsense-symlinks-due-to-udev-change-of-strin.patch drbd-utils-8.9.10/debian/patches/fix-nonsense-symlinks-due-to-udev-change-of-strin.patch --- drbd-utils-8.9.10/debian/patches/fix-nonsense-symlinks-due-to-udev-change-of-strin.patch 1969-12-31 19:00:00.000000000 -0500 +++ drbd-utils-8.9.10/debian/patches/fix-nonsense-symlinks-due-to-udev-change-of-strin.patch 2018-05-25 11:17:50.000000000 -0400 @@ -0,0 +1,61 @@ +From: Lars Ellenberg +Subject: [PATCH] v9: fix nonsense symlinks due to udev change of + string_escape=none -> replace +Bug-Debian: https://bugs.debian.org/900065 +Bug-Ubuntu: https://launchpad.net/bugs/1673255 +Origin: upstream, https://github.com/LINBIT/drbd-utils/commit/05c0797248af6f4e3b5b04545fe068dba41e3d81 +--- a/scripts/drbd.rules.in ++++ b/scripts/drbd.rules.in +@@ -6,7 +6,12 @@ + IMPORT{program}="@sbindir@/drbdadm sh-udev minor-%m" + + # Use symlink from the environment if available +-ENV{SYMLINK}!="", SYMLINK="$env{SYMLINK}", GOTO="have_symlink" ++# some udev version thought it was a good idea to change a long established ++# default of string_escape=none to string_escape=replace :-/ ++# therefore, recent enough drbdadm will no longer export space separated lists. ++ENV{SYMLINK_BY_DISK}!="", SYMLINK+="$env{SYMLINK_BY_DISK}" ++ENV{SYMLINK_BY_RES}!="", SYMLINK+="$env{SYMLINK_BY_RES}", GOTO="have_symlink" ++ENV{SYMLINK}!="", OPTIONS+="string_escape=none", SYMLINK="$env{SYMLINK}", GOTO="have_symlink" + + # Legacy rules for older DRBD 8.3 & 8.4 when drbdadm sh-udev did not yet export SYMLINK + ENV{DISK}!="", SYMLINK+="drbd/by-disk/$env{DISK}" +--- a/user/v9/drbdadm_main.c ++++ b/user/v9/drbdadm_main.c +@@ -840,18 +840,31 @@ + else + printf("DEVICE=drbd%u\n", vol->device_minor); + ++ /* in case older udev rules are still in place, ++ * but do not yet have the work-around for the ++ * udev default change of "string_escape=none" -> "replace", ++ * populate plain "SYMLINK" with just the "by-res" one. */ + printf("SYMLINK="); + if (vol->implicit) +- printf("drbd/by-res/%s", res->name); ++ printf("drbd/by-res/%s\n", res->name); + else +- printf("drbd/by-res/%s/%u", res->name, vol->vnr); ++ printf("drbd/by-res/%s/%u\n", res->name, vol->vnr); ++ ++ /* repeat, with _BY_RES */ ++ printf("SYMLINK_BY_RES="); ++ if (vol->implicit) ++ printf("drbd/by-res/%s\n", res->name); ++ else ++ printf("drbd/by-res/%s/%u\n", res->name, vol->vnr); ++ ++ /* and add the _BY_DISK one explicitly */ + if (vol->disk) { ++ printf("SYMLINK_BY_DISK="); + if (!strncmp(vol->disk, "/dev/", 5)) +- printf(" drbd/by-disk/%s", vol->disk + 5); ++ printf("drbd/by-disk/%s\n", vol->disk + 5); + else +- printf(" drbd/by-disk/%s", vol->disk); ++ printf("drbd/by-disk/%s\n", vol->disk); + } +- printf("\n"); + + return 0; + } diff -Nru drbd-utils-8.9.10/debian/patches/series drbd-utils-8.9.10/debian/patches/series --- drbd-utils-8.9.10/debian/patches/series 2017-05-12 07:43:00.000000000 -0400 +++ drbd-utils-8.9.10/debian/patches/series 2018-05-25 11:17:50.000000000 -0400 @@ -5,3 +5,4 @@ initscript-remove-path.patch reproducible-build initscript-add-start-runlevels.patch +fix-nonsense-symlinks-due-to-udev-change-of-strin.patch