ksud: support common post-fs-data.d and service.d

This commit is contained in:
tiann
2023-02-02 08:39:19 +08:00
parent 2bba088319
commit cd825e34da
2 changed files with 70 additions and 8 deletions

View File

@@ -139,6 +139,9 @@ pub fn on_post_data_fs() -> Result<()> {
// module mounted, exec modules post-fs-data scripts
if !crate::utils::is_safe_mode() {
// todo: Add timeout
if let Err(e) = crate::module::exec_common_scripts("post-fs-data.d", true) {
warn!("exec common post-fs-data scripts failed: {}", e);
}
if let Err(e) = crate::module::exec_post_fs_data() {
warn!("exec post-fs-data scripts failed: {}", e);
}
@@ -155,6 +158,9 @@ pub fn on_post_data_fs() -> Result<()> {
pub fn on_services() -> Result<()> {
// exec modules service.sh scripts
if !crate::utils::is_safe_mode() {
if let Err(e) = crate::module::exec_common_scripts("service.d", false) {
warn!("exec common service scripts failed: {}", e);
}
if let Err(e) = crate::module::exec_services() {
warn!("exec service scripts failed: {}", e);
}