summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-12-04 19:12:36 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-12-05 08:22:52 +0900
commitbf331d87171b7750d1c72ab0b140a240c0cf32c3 (patch)
tree0df159e2ed31e1edb23e74d80fcbfb6057b93ba2
parent26208d5b9674079dcf2c9d301f09a7c7b23bfdc3 (diff)
downloadsystemd-bf331d87171b7750d1c72ab0b140a240c0cf32c3.tar.gz
network: if /sys is rw, then udev should be around
This switches detect_container() to path_is_read_only_rw("/sys"), as if systemd-udevd.service is conditionalized with that way. This also updates the log message.
-rw-r--r--src/network/networkd-link.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 36d24fd0f3..fc822d1052 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -36,6 +36,7 @@
#include "qdisc.h"
#include "set.h"
#include "socket-util.h"
+#include "stat-util.h"
#include "stdio-util.h"
#include "string-table.h"
#include "strv.h"
@@ -43,7 +44,6 @@
#include "tmpfile-util.h"
#include "udev-util.h"
#include "util.h"
-#include "virt.h"
#include "vrf.h"
uint32_t link_get_vrf_table(Link *link) {
@@ -3292,8 +3292,8 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
if (r < 0)
return r;
- if (detect_container() <= 0) {
- /* not in a container, udev will be around */
+ if (path_is_read_only_fs("/sys") <= 0) {
+ /* udev should be around */
sprintf(ifindex_str, "n%d", link->ifindex);
r = sd_device_new_from_device_id(&device, ifindex_str);
if (r < 0) {
@@ -3303,7 +3303,7 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
r = sd_device_get_is_initialized(device);
if (r < 0) {
- log_link_warning_errno(link, r, "Could not determine whether the device is initialized or not: %m");
+ log_link_warning_errno(link, r, "Could not determine whether the device is initialized: %m");
goto failed;
}
if (r == 0) {
@@ -3314,11 +3314,11 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
r = device_is_renaming(device);
if (r < 0) {
- log_link_warning_errno(link, r, "Failed to determine the device is renamed or not: %m");
+ log_link_warning_errno(link, r, "Failed to determine the device is being renamed: %m");
goto failed;
}
if (r > 0) {
- log_link_debug(link, "Interface is under renaming, pending initialization.");
+ log_link_debug(link, "Interface is being renamed, pending initialization.");
return 0;
}