Commit 645bba3a authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

If possible, replace symbolic links in place

Naive 'ln -s -f a b' will put the link inside 'b', if
'b' is (a symlink to) a directory; so, during upgrades,
the links in $(sysconfdir) cannot be updated this way.
Removing and readding works, however leaves the risk
of the upgrade process dying in that very moment, thus
leaving 'gnt-cluster' a dangling link, so that the --resume
option is of no help. On GNU systems, avoid this problem
by using the -T option of GNU ln.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarHelga Velroyen <>
parent d250bc5d
......@@ -1723,6 +1723,16 @@ def _SetGanetiVersion(versionstring):
failed = []
if constants.HAS_GNU_LN:
["ln", "-s", "-f", "-T",
os.path.join(pathutils.PKGLIBDIR, versionstring),
os.path.join(pathutils.SYSCONFDIR, "ganeti/lib")]))
["ln", "-s", "-f", "-T",
os.path.join(pathutils.SHAREDIR, versionstring),
os.path.join(pathutils.SYSCONFDIR, "ganeti/share")]))
["rm", "-f", os.path.join(pathutils.SYSCONFDIR, "ganeti/lib")]))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment