File 0001-Medium-symlink-Handle-missing-directories-in-target-.patch of Package resource-agents.2497
From 8fc335b2d7f02c77758ab591aa04adebb7092bdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Mon, 18 Apr 2016 08:36:52 +0200
Subject: [PATCH] Medium: symlink: Handle missing directories in target
(bsc#973054)
If the directory in which the symlink target is not existing, migration
after failure fails due to the probe reporting an error on the failed
node with a broken symlink.
To handle this, use "readlink -m" over "readlink -f". From the readlink
man page:
> -f, --canonicalize
> canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist
>
> -e, --canonicalize-existing
> canonicalize by following every symlink in every component of the given name recursively, all components must exist
>
> -m, --canonicalize-missing
> canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence
---
heartbeat/symlink | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/heartbeat/symlink b/heartbeat/symlink
index 1e36a9c..dbf633e 100755
--- a/heartbeat/symlink
+++ b/heartbeat/symlink
@@ -123,7 +123,7 @@ symlink_monitor() {
ocf_log debug "$OCF_RESKEY_link exists but is not a symbolic link, will be moved to ${OCF_RESKEY_link}${OCF_RESKEY_backup_suffix} on start"
rc=$OCF_NOT_RUNNING
fi
- elif readlink -f "$OCF_RESKEY_link" | egrep -q "^${OCF_RESKEY_target}$"; then
+ elif readlink -m "$OCF_RESKEY_link" | egrep -q "^${OCF_RESKEY_target}$"; then
ocf_log debug "$OCF_RESKEY_link exists and is a symbolic link to ${OCF_RESKEY_target}."
rc=$OCF_SUCCESS
else
--
2.8.1