drbd udev rule with multiple symlinks fails

Bug #1673255 reported by Dan Streetman on 2017-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
drbd-utils (Debian)
Fix Released
Unknown
drbd-utils (Ubuntu)
Low
Dan Streetman
Xenial
Low
Dan Streetman
Bionic
Low
Dan Streetman
Cosmic
Low
Dan Streetman

Bug Description

The drbd udev rule creates multiple symlinks with a single udev rule, by space-separating them inside an env var. However, recent udev changes no longer allow doing that:
https://github.com/systemd/systemd/issues/4833

Now, recent versions of udev will, by default, replace any whitespace introduced into SYMLINK values by variable substitution, so the drbd udev rule that does this breaks:

ENV{SYMLINK}!="", SYMLINK="$env{SYMLINK}", GOTO="have_symlink"

when that SYMLINK env variable contains multiple symlinks, they are combined into a single symlink with an underscore joining them. Instead, since it's desired to leave all spaces in the env var in order to create multiple symlinks, the rule needs to use the "string_escape=none" option which prevents whitespace replacement:

ENV{SYMLINK}!="", SYMLINK="$env{SYMLINK}", OPTIONS+="string_escape=none", GOTO="have_symlink"

Related ubuntu bug that introduced the new udev default whitespace replacement behavior:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1647485

Dan Streetman (ddstreet) wrote :

Alternately, the drbd udev rule could be refactored, so it didn't place multiple symlinks into an env variable; for example, it could do this:

PROGRAM="/usr/sbin/drbdadm sh-udev minor-%m", SYMLINK="$result",
GOTO="have_symlink"

however, it would need to:

1) make the program return return success (0) if the symlink should be
created, and return failure (!0) if not
2) return only the plain-text symlinks strings; no "SYMLINK="
assignment

However, that would require updating the drbdadm program output as well as the udev rule.

Dan Streetman (ddstreet) on 2017-03-17
Changed in drbd-utils:
status: New → In Progress
assignee: nobody → Dan Streetman (ddstreet)
Dan Streetman (ddstreet) on 2018-05-25
affects: drbd-utils → drbd-utils (Ubuntu)
Changed in drbd-utils (Ubuntu Trusty):
status: New → In Progress
Changed in drbd-utils (Ubuntu Xenial):
status: New → In Progress
Changed in drbd-utils (Ubuntu Artful):
status: New → In Progress
Changed in drbd-utils (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Dan Streetman (ddstreet)
Changed in drbd-utils (Ubuntu Artful):
assignee: nobody → Dan Streetman (ddstreet)
Changed in drbd-utils (Ubuntu Xenial):
assignee: nobody → Dan Streetman (ddstreet)
Changed in drbd-utils (Ubuntu Trusty):
assignee: nobody → Dan Streetman (ddstreet)
importance: Undecided → Low
Changed in drbd-utils (Ubuntu Xenial):
importance: Undecided → Low
Changed in drbd-utils (Ubuntu Artful):
importance: Undecided → Critical
importance: Critical → Low
Changed in drbd-utils (Ubuntu Bionic):
importance: Undecided → Low
Changed in drbd-utils (Ubuntu Cosmic):
importance: Undecided → Low
Dan Streetman (ddstreet) wrote :

No fix needed in trusty; the drbd rules file is different in that older version and will not be affected by the udev behavior change (the rules file contains the space directly in its string value, not in a substituted variable, so udev will process the space correctly and the behavior change only affects whitespace inside substituted variables inside SYMLINK assignment in rules files).

Changed in drbd-utils (Ubuntu Trusty):
status: In Progress → Invalid
Dan Streetman (ddstreet) wrote :
tags: added: patch
Changed in drbd-utils (Debian):
status: Unknown → New
Eric Desrochers (slashd) wrote :

Sponsored for Cosmic, please keep an eye at the "excuses..." page to make sure the package is not stuck in cosmic-proposed.

Thanks !

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package drbd-utils - 8.9.10-2ubuntu1

---------------
drbd-utils (8.9.10-2ubuntu1) cosmic; urgency=medium

  * Fix creation of drbd symlinks with newer udev.
    (LP: #1673255)

 -- Dan Streetman <email address hidden> Fri, 25 May 2018 11:17:50 -0400

Changed in drbd-utils (Ubuntu Cosmic):
status: In Progress → Fix Released
Changed in drbd-utils (Debian):
status: New → Fix Released
Dan Streetman (ddstreet) on 2019-04-04
no longer affects: drbd-utils (Ubuntu Trusty)
no longer affects: drbd-utils (Ubuntu Artful)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.