All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Verma <vishal.l.verma@intel.com>
To: <nvdimm@lists.linux.dev>
Cc: Vishal Verma <vishal.l.verma@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Chunhong Mao <chunhong.mao@intel.com>
Subject: [ndctl PATCH] daxctl: fix systemd escaping for 90-daxctl-device.rules
Date: Mon, 18 Apr 2022 12:53:36 -0600	[thread overview]
Message-ID: <20220418185336.1192330-1-vishal.l.verma@intel.com> (raw)

Older systemd was more tolerant of how unit names are passed in for
instantiated services via a udev rule, but of late, systemd flags
unescaped unit names, with an error such as:

  fedora systemd[1]: Invalid unit name "daxdev-reconfigure@/dev/dax0.0.service"
  escaped as "daxdev-reconfigure@-dev-dax0.0.service" (maybe you should use
  systemd-escape?).

Update the udev rule to pass the 'DEVNAME' from env through an
appropriate systemd-escape template so that it generates the correctly
escaped string.

Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Chunhong Mao <chunhong.mao@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 daxctl/90-daxctl-device.rules | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/daxctl/90-daxctl-device.rules b/daxctl/90-daxctl-device.rules
index ee0670f..e02e7ec 100644
--- a/daxctl/90-daxctl-device.rules
+++ b/daxctl/90-daxctl-device.rules
@@ -1 +1,3 @@
-ACTION=="add", SUBSYSTEM=="dax", TAG+="systemd", ENV{SYSTEMD_WANTS}="daxdev-reconfigure@$env{DEVNAME}.service"
+ACTION=="add", SUBSYSTEM=="dax", TAG+="systemd",\
+  PROGRAM="/usr/bin/systemd-escape -p --template=daxdev-reconfigure@.service $env{DEVNAME}",\
+  ENV{SYSTEMD_WANTS}="%c"

base-commit: 97031db9300654260bc2afb45b3600ac01beaeba
-- 
2.35.1


             reply	other threads:[~2022-04-18 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 18:53 Vishal Verma [this message]
2022-04-18 19:15 ` [ndctl PATCH] daxctl: fix systemd escaping for 90-daxctl-device.rules Dan Williams
2022-04-18 19:47   ` Verma, Vishal L
2022-04-18 19:52     ` Dan Williams
2022-04-19  5:02     ` Mao, Chunhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220418185336.1192330-1-vishal.l.verma@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=chunhong.mao@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=nvdimm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.