[Libguestfs] [PATCH 3/4] p2v: virt-p2v-make-disk: fix systemd paths

Pino Toscano ptoscano at redhat.com
Fri Mar 17 17:11:49 UTC 2017


Usually systemd is configured with prefix=/, so units are in
/lib/systemd.  On a system with UsrMove, such as Fedora/RHEL7, /lib is
a symlink to /usr/lib, so both /lib/systemd and /usr/lib/systemd work;
OTOH, on non-UsrMove systems, such as Debian, the two paths are
different locations, and thus trying to edit system files as
/usr/lib/systemd/etc will fail.

As solution, just reference /lib/systemd for systemd files.
---
 p2v/virt-p2v-make-disk.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in
index 6b7f15a..6b82eaf 100644
--- a/p2v/virt-p2v-make-disk.in
+++ b/p2v/virt-p2v-make-disk.in
@@ -241,9 +241,9 @@ virt-builder "$osversion"                                       \
     --chmod 0755:/usr/bin/launch-virt-p2v                       \
     --upload "$datadir"/p2v.service:/etc/systemd/system/        \
     --mkdir /etc/systemd/system/default.target.wants            \
-    --link /usr/lib/systemd/system/multi-user.target:/etc/systemd/system/default.target \
+    --link /lib/systemd/system/multi-user.target:/etc/systemd/system/default.target \
     --link /etc/systemd/system/p2v.service:/etc/systemd/system/default.target.wants/p2v.service \
-    --edit '/usr/lib/systemd/system/getty at .service:
+    --edit '/lib/systemd/system/getty at .service:
         s/^ExecStart=(.*)/ExecStart=$1 -a root/
     '                                                           \
     --edit '/etc/systemd/logind.conf:
-- 
2.9.3




More information about the Libguestfs mailing list