代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lxc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e86ebe923f1ecc072d8a99949871b46fe8188ac9 Mon Sep 17 00:00:00 2001
From: wujing <wujing50@huawei.com>
Date: Wed, 15 Apr 2020 06:01:36 -0400
Subject: [PATCH 32/49] link proc mounts to etc mtab
Signed-off-by: wujing <wujing50@huawei.com>
---
src/lxc/conf.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 325e0c2..6856b1d 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -3977,6 +3977,37 @@ struct oci_hook_conf {
int which;
};
+static int create_mtab_link()
+{
+ ssize_t ret;
+ int mret;
+ struct stat sbuf;
+ const char *pathname = "/proc/mounts";
+ const char *slink = "/etc/mtab";
+
+ if (file_exists(slink)) {
+ return 0;
+ }
+
+ ret = stat(pathname, &sbuf);
+ if (ret < 0) {
+ SYSERROR("Failed to stat %s: %s", pathname, strerror(errno));
+ return -1;
+ }
+
+ mret = symlink(pathname, slink);
+ if (mret < 0 && errno != EEXIST) {
+ if (errno == EROFS) {
+ WARN("Failed to create link %s for target %s. Read-only filesystem", slink, pathname);
+ } else {
+ SYSERROR("Failed to create \"%s\"", slink);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
struct wait_conf {
pid_t pid;
unsigned long long startat;
@@ -4696,6 +4727,12 @@ int lxc_setup(struct lxc_handler *handler)
return log_error(-1, "failed to setup readonlypaths");
}
}
+
+ // isulad: create link /etc/mtab for /proc/mounts
+ if (create_mtab_link() != 0) {
+ ERROR("failed to create link /etc/mtab for target /proc/mounts");
+ goto on_error;
+ }
#endif
if (!lxc_list_empty(&lxc_conf->keepcaps)) {
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。