diff options
author | Vishal Verma <vishal.l.verma@intel.com> | 2022-04-18 12:42:09 -0600 |
---|---|---|
committer | Vishal Verma <vishal.l.verma@intel.com> | 2022-06-15 16:28:51 -0600 |
commit | ec18286d0e0212af6eee8cb382db5ba061eef3bc (patch) | |
tree | 8ff6fe63feb7da4e7f42b11dddbcbc2d136cd06e | |
parent | 318375a08b794acf4bb63333ecf3819928f1c9e5 (diff) |
daxctl: fix systemd escaping for 90-daxctl-device.rules
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.
Link: https://lore.kernel.org/nvdimm/20220418185336.1192330-1-vishal.l.verma@intel.com/
Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Chunhong Mao <chunhong.mao@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Chunhong Mao <chunhong.mao@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
-rw-r--r-- | daxctl/90-daxctl-device.rules | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/daxctl/90-daxctl-device.rules b/daxctl/90-daxctl-device.rules index ee0670f4..e02e7ecf 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" |