summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-04-21 09:27:20 -0500
committerDavid Teigland <teigland@redhat.com>2016-04-21 09:27:20 -0500
commitd00b70c789cca1ca73b3d1311db9981d9ca5056b (patch)
tree6c55fc675720b57a511d7754b9f56119196c5539
parent0778d2e9857966e2d7e8f44c7f769fbdebb03a73 (diff)
downloadlvm2-d00b70c789cca1ca73b3d1311db9981d9ca5056b.tar.gz
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.
-rw-r--r--lib/cache/lvmetad.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index bbf355063..e50234a08 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -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;