From: Jaehyun Kim Date: Fri, 29 Oct 2021 10:17:55 +0000 (+0900) Subject: Disabled in container environment X-Git-Tag: submit/tizen/20211117.050637~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7da24a6a80b2542ee10756e3ed7a2c4bf34301c;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Disabled in container environment Disable the container's network daemons to avoid conflicts because they use the same network namespace. Change-Id: I77b667419499c1d3306ee1a3b833b0f942586428 Signed-off-by: Jaehyun Kim --- diff --git a/src/main.c b/src/main.c index c4b7565..04d7f63 100755 --- a/src/main.c +++ b/src/main.c @@ -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");