mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 02:09:26 +08:00
packages.info: use biu::exec
This commit is contained in:
@@ -156,17 +156,8 @@ int main()
|
|||||||
if (context == "epilog_slurmctld" && !output_file.empty())
|
if (context == "epilog_slurmctld" && !output_file.empty())
|
||||||
{
|
{
|
||||||
auto text = "\n--------------------\n{}\n--------------------\n"_f(info);
|
auto text = "\n--------------------\n{}\n--------------------\n"_f(info);
|
||||||
boost::asio::io_context context;
|
biu::exec<{.SearchPath = true, .Stdin = biu::IoType::String}>
|
||||||
boost::system::error_code ec;
|
({.Program = "tee", .Args = { "-a", output_file }, .Stdin = text}, switch_user(uid, gid));
|
||||||
boost::asio::writable_pipe wp{context};
|
|
||||||
boost::process::v2::process proc
|
|
||||||
(
|
|
||||||
context, "/run/current-system/sw/bin/tee", { "-a", output_file.c_str() },
|
|
||||||
boost::process::v2::process_stdio{wp, nullptr, nullptr}, switch_user(uid, gid)
|
|
||||||
);
|
|
||||||
boost::asio::write(wp, boost::asio::buffer(text));
|
|
||||||
wp.close();
|
|
||||||
proc.wait();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user