Skip to contentSkip to conversation

master - lvmetad: check for socket in connect

PATCH David Teigland 1 participant 1 message Apr 21, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d00b70c789cca1ca73b3d1311db9981d9ca5056b
Commit:        d00b70c789cca1ca73b3d1311db9981d9ca5056b
Parent:        0778d2e9857966e2d7e8f44c7f769fbdebb03a73
Author:        David Teigland <[email protected]>
AuthorDate:    Thu Apr 21 09:27:20 2016 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Thu Apr 21 09:27:20 2016 -0500

lvmetad: check for socket in connect

We can connect if the socket is present, even
though the pidfile may not exist, since systemd
may start the process when the socket is opened.

---
 lib/cache/lvmetad.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/cache/lvmetad.c +2 -2
index bbf3550..e50234a 100644
@@ -126,8 +126,8 @@ void lvmetad_disconnect(void)
 
 int lvmetad_connect(struct cmd_context *cmd)
 {
-	if (access(getenv("LVM_LVMETAD_PIDFILE") ? : LVMETAD_PIDFILE, F_OK)) {
-		log_debug_lvmetad("Failed to connect to lvmetad: not running.");
+	if (!lvmetad_socket_present()) {
+		log_debug_lvmetad("Failed to connect to lvmetad: socket not present.");
 		_lvmetad_connected = 0;
 		_lvmetad_use = 0;
 		_lvmetad_cmd = NULL;