Skip to contentSkip to conversation

Use LVM_PATH instead of hard-coded /usr/sbin/lvm

PATCH In review Michael Stapelberg 2 participants 2 messages Aug 14, 2013 – Aug 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use LVM_PATH instead of hard-coded /usr/sbin/lvm

Hi,

I noticed that the systemd generator hardcodes /usr/sbin/lvm.

Attached you can find a patch which fixes the issue. Please merge it or fix the issue in a different way if you prefer :). Thanks!

Signature · 2 lines
Best regards,
Michael

Description: Use LVM_PATH instead of hard-coded /usr/sbin/lvm
Author: Michael Stapelberg <[email protected]>
Last-Update: 2013-08-14

---

scripts/lvm2_activation_generator_systemd_red_hat.c +2 -1
Index: lvm2-2.02.98/scripts/lvm2_activation_generator_systemd_red_hat.c
===================================================================
@@ -20,6 +20,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include "lvm2app.h"
+#include "lib.h" /* for LVM_PATH */
 
 #define KMSG_DEV_PATH        "/dev/kmsg"
 #define LVM_CONF_USE_LVMETAD "global/use_lvmetad"
@@ -125,7 +126,7 @@
 	fputs("Before=local-fs.target shutdown.target\n"
 	      "Wants=systemd-udev-settle.service\n\n"
 	      "[Service]\n"
-	      "ExecStart=/usr/sbin/lvm vgchange -aay --sysinit\n"
+	      "ExecStart=" LVM_PATH " vgchange -aay --sysinit\n"
 	      "Type=oneshot\n", f);
 
 	if (fclose(f) < 0) {
#1 lore raw
Quoted 4 lines · Michael Stapelberg

I noticed that the systemd generator hardcodes /usr/sbin/lvm.

Attached you can find a patch which fixes the issue. Please merge it or fix the issue in a different way if you prefer :). Thanks!

I've just changed the #include "lib.h" to #include "configure.h" which is sufficient here. Upstream now:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=8cbbe851a80e8d99dc886ce9b44834137731d8ce

Thanks for the patch.

Peter