From 1567e31e8452e3cc886a042da178907580488360 Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Tue, 29 Aug 2023 20:16:50 +0800 Subject: [PATCH] set flag for bash --- bin/aot.rs | 7 +++++++ bin/daemon.rs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/bin/aot.rs b/bin/aot.rs index 0e3a854..c1d9907 100644 --- a/bin/aot.rs +++ b/bin/aot.rs @@ -156,6 +156,13 @@ pub fn gen_app_rto(conf: &RtoConfig) -> i32 { if ret != 0 { return ret; } + let mut set_bash: Vec = Vec::new(); + set_bash.push("--set".to_string()); + set_bash.push("/usr/bin/bash".to_string()); + ret = run_child(SYSBOOST_PATH, &set_bash); + if ret != 0 { + return ret; + } //ret = fs_ext::move_file(&format!("{}.rto", conf.elf_path), &format!("{}.tmp.rto", conf.elf_path)); return ret; } diff --git a/bin/daemon.rs b/bin/daemon.rs index 8781d2a..5d404b5 100644 --- a/bin/daemon.rs +++ b/bin/daemon.rs @@ -215,6 +215,13 @@ fn clean_last_rto() { set_app_aot_flag(&p, false); db_remove_link(&p); } + let ret = fs::remove_file("/usr/bin/bash.rto"); + match ret { + Ok(_) => return, + Err(e) => { + log::info!("remove bash.rto failed: {}", e); + } + }; } fn watch_old_files_perapp(conf: &RtoConfig, inotify: &mut Inotify) { -- Gitee