!88 fix: resolve not mounted home

From: @zhang-yao-2022 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
This commit is contained in:
openeuler-ci-bot 2024-04-17 07:51:24 +00:00 committed by Gitee
commit d4eb22fbfc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 0f2708a50893911bd650e3b855e7b470b6c316a9 Mon Sep 17 00:00:00 2001
From: zhangyao2022 <zhangyao108@huawei.com>
Date: Mon, 15 Apr 2024 08:14:58 +0800
Subject: [PATCH] fix: resolve not mount home
---
exts/fstab/src/main.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/exts/fstab/src/main.rs b/exts/fstab/src/main.rs
index 09d7dd34..4eea27dd 100644
--- a/exts/fstab/src/main.rs
+++ b/exts/fstab/src/main.rs
@@ -136,7 +136,7 @@ fn watch_devices(fstab_items: &[FSTabItem]) -> (Inotify, HashSet<String>) {
file_path.file_name().unwrap().to_str().unwrap(),
));
inotify
- .add_watch(dir_path, WatchMask::CREATE)
+ .add_watch(dir_path, WatchMask::CREATE | WatchMask::MOVED_TO)
.expect("Failed to add watch.");
}
(inotify, watch_set)
@@ -171,8 +171,10 @@ fn main() {
.read_events_blocking(&mut buffer)
.expect("Failed to read events.");
for event in events {
- if event.mask == EventMask::CREATE {
- log::debug!("File created: {:?}", event.name.unwrap());
+ if event.mask == EventMask::CREATE || event.mask == EventMask::MOVED_TO {
+ if let Some(name) = event.name {
+ log::debug!("File created or moved: {:?}", name);
+ }
watch_updated = true;
}
}
--
2.33.0

View File

@ -12,7 +12,7 @@
Name: sysmaster
Version: 1.0.0
Release: 4
Release: 5
Summary: redesign and reimplement process1.
License: Mulan PSL v2
@ -22,6 +22,7 @@ Source0: %{name}-%{version}.tar.xz
Patch0: backport-feature-devmaster-add-net_driver-builtin-to-be-compa.patch
Patch1: backport-fix-resolve-wantedby-invalid.patch
Patch2: backport-fix-read-pid-cmdline-incorrect.patch
Patch3: backport-fix-resolve-not-mount-home.patch
ExclusiveArch: x86_64 aarch64
@ -163,6 +164,9 @@ if [ $1 -eq 0 ] ; then
fi
%changelog
* Wed Apr 17 2024 zhangyao<zhangyao108@huawei.com> - 1.0.0-5
- resolve not mounted home
* Thu Apr 11 2024 zhangyao<zhangyao108@huawei.com> - 1.0.0-4
- read pid cmdline incorrect