1 Star 0 Fork 49

YYNA/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0334-test-replace-tail-f-with-journal-cursor-which-should.patch 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-04-20 15:17 . update to systemd-239-31.el8_2.2
From b93a2617d49d9636801130d974995cabe6335b71 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Mon, 1 Jul 2019 09:27:59 +0200
Subject: [PATCH] test: replace `tail -f` with journal cursor which should
be...
more reliable
(cherry picked from commit d0b2178f3e79f302702bd7140766eee03643f734)
Related: #1808940
---
test/TEST-36-NUMAPOLICY/testsuite.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
index e15087b137..306a96b517 100755
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
@@ -29,6 +29,9 @@ testUnitNUMAConf="$testUnitFile.d/numa.conf"
journalSleep=5
sleepAfterStart=1
+# Journal cursor for easier navigation
+journalCursorFile="jounalCursorFile"
+
startStrace() {
coproc strace -qq -p 1 -o $straceLog -e set_mempolicy -s 1024 $1
}
@@ -38,18 +41,16 @@ stopStrace() {
}
startJournalctl() {
- coproc journalctl -u init.scope -f > $journalLog
+ # Save journal's cursor for later navigation
+ journalctl --no-pager --cursor-file="$journalCursorFile" -n0 -ocat
}
stopJournalctl() {
- # Wait a few seconds until the messages get properly queued...
- sleep $journalSleep
- # ...and then force journald to write them to the backing storage
- # Also, using journalctl --sync should be better than using SIGRTMIN+1, as
+ # Using journalctl --sync should be better than using SIGRTMIN+1, as
# the --sync wait until the synchronization is complete
echo "Force journald to write all queued messages"
journalctl --sync
- kill -s TERM $COPROC_PID
+ journalctl -u init.scope --cursor-file="$journalCursorFile" > "$journalLog"
}
checkNUMA() {
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ful9/systemd.git
git@gitee.com:ful9/systemd.git
ful9
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385