Install lttng/lttng-sessiond-comm.h into system
[lttng-tools.git] / liblttngctl / liblttngctl.c
index 4faf8414f7cf5d7deb31f2658ee0a7a850a1fe00..de18210321fb8378a7e61f89470ecf6f4335823f 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <lttng/lttng.h>
 
-#include "liblttsessiondcomm.h"
+#include <lttng/lttng-sessiond-comm.h>
 #include "lttngerr.h"
 #include "lttng-share.h"
 
@@ -608,13 +608,22 @@ int lttng_session_daemon_alive(void)
                return ret;
        }
 
-       /* If socket exist, we consider the daemon started */
+       /* If socket exist, we check if the daemon listens to connect. */
        ret = access(sessiond_sock_path, F_OK);
        if (ret < 0) {
                /* Not alive */
                return 0;
        }
 
+       ret = lttcomm_connect_unix_sock(sessiond_sock_path);
+       if (ret < 0) {
+               /* Not alive */
+               return 0;
+       }
+       ret = lttcomm_close_unix_sock(ret);
+       if (ret < 0)
+               perror("lttcomm_close_unix_sock");
+
        /* Is alive */
        return 1;
 }
This page took 0.028535 seconds and 5 git commands to generate.