Skip to content

Commit

Permalink
Exec bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
htngr committed Sep 26, 2024
1 parent e15a88d commit 7208a65
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codchi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> anyhow::Result<()> {
if cli.terminal == Some(false) {
dbg_duration("hide console", || {
let window = unsafe { GetConsoleWindow() };
if window.0.is_null() {
if !window.0.is_null() {
if let Err(err) =
unsafe { ShowWindow(window, WindowsAndMessaging::SW_HIDE).ok() }
{
Expand Down
1 change: 1 addition & 0 deletions codchi/src/platform/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ tail -f "{log_file}"
// Machine is started by issuing a command
self.cmd()
.script(r#"systemctl is-system-running | grep -E "running|degraded""#.to_string())
.with_user(LinuxUser::Default)
.retry_until_ok();

cancel_tx
Expand Down
2 changes: 1 addition & 1 deletion codchi/src/platform/windows/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Host for HostImpl {
if let Some((cmd, args)) = cmd.split_first() {
Command::new(cmd)
.args(args)
.creation_flags(CREATE_NEW_PROCESS_GROUP.0 | CREATE_NEW_CONSOLE.0)
.creation_flags(CREATE_NEW_CONSOLE.0)
.spawn()?;
} else {
anyhow::bail!("Failed to open terminal with an empty command");
Expand Down
2 changes: 1 addition & 1 deletion nix/container/machine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ in
# TODO ?? Reset the logging file descriptors.
echo "starting systemd..."
exec /run/current-system/systemd/lib/systemd/systemd "$@"
exec /run/current-system/systemd/lib/systemd/systemd "--log-target=kmsg" "$@"
'';
};

Expand Down

0 comments on commit 7208a65

Please sign in to comment.