Disabled in container environment 42/265842/2
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 29 Oct 2021 10:17:55 +0000 (19:17 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Tue, 9 Nov 2021 05:05:08 +0000 (14:05 +0900)
Disable the container's network daemons to avoid conflicts
because they use the same network namespace.

Change-Id: I77b667419499c1d3306ee1a3b833b0f942586428
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/main.c

index c4b7565..04d7f63 100755 (executable)
@@ -48,6 +48,7 @@ static GMainLoop *main_loop = NULL;
 
 /*Poll the ethernet Cable Plug-in /Plug-out status at every 1000 ms*/
 #define ETH_POLLING_TIME       1000
+#define CONTAINER_FILE "/run/systemd/container"
 
 /* Callback to Poll the Ethernet Status*/
 gboolean __net_ethernet_cable_status_polling_callback(gpointer data)
@@ -112,6 +113,19 @@ int main(int argc, char *argv[])
        g_type_init();
 #endif
 
+       main_loop = g_main_loop_new(NULL, FALSE);
+       if (main_loop == NULL) {
+               ERR("Couldn't create GMainLoop\n");
+               log_cleanup();
+               return 0;
+       }
+
+       if (access(CONTAINER_FILE, F_OK) == 0) {
+               g_main_loop_run(main_loop);
+               log_cleanup();
+               return 0;
+       }
+
        /* Backward compatibility:
         * Execute only when the old style hal architecture is not running
         */
@@ -124,12 +138,6 @@ int main(int argc, char *argv[])
                g_free(ifname);
        }
 
-       main_loop = g_main_loop_new(NULL, FALSE);
-       if (main_loop == NULL) {
-               ERR("Couldn't create GMainLoop\n");
-               return 0;
-       }
-
        ret = setup_gdbus(_got_name_cb);
        if (ret > 0) {
                ERR("_netconfig_setup_gdbus is failed\n");