diff --git a/l4d2host/instances.py b/l4d2host/instances.py index 68aceb3..d6218a6 100644 --- a/l4d2host/instances.py +++ b/l4d2host/instances.py @@ -84,6 +84,7 @@ def start_instance( env = _load_instance_env(instance_dir / "instance.env") + _emit_step("mounting runtime overlay...", on_stdout, passthrough) run_command( [ "fuse-overlayfs", @@ -101,10 +102,12 @@ def start_instance( should_cancel=should_cancel, ) + _emit_step("copying server.cfg to runtime...", on_stdout, passthrough) target_cfg = runtime_dir / "merged" / "left4dead2" / "cfg" / "server.cfg" target_cfg.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(instance_dir / "server.cfg", target_cfg) + _emit_step("starting systemd service...", on_stdout, passthrough) start_service( name, on_stdout=on_stdout, @@ -112,6 +115,7 @@ def start_instance( passthrough=passthrough, should_cancel=should_cancel, ) + _emit_step("start complete.", on_stdout, passthrough) def stop_instance( @@ -124,6 +128,7 @@ def stop_instance( should_cancel: Callable[[], bool] | None = None, ) -> None: root = get_left4me_root() if root is None else Path(root) + _emit_step("stopping systemd service...", on_stdout, passthrough) stop_service( name, on_stdout=on_stdout, @@ -131,6 +136,7 @@ def stop_instance( passthrough=passthrough, should_cancel=should_cancel, ) + _emit_step("unmounting runtime overlay...", on_stdout, passthrough) run_command( ["fusermount3", "-u", str(root / "runtime" / name / "merged")], on_stdout=on_stdout, @@ -138,6 +144,7 @@ def stop_instance( passthrough=passthrough, should_cancel=should_cancel, ) + _emit_step("stop complete.", on_stdout, passthrough) def delete_instance( @@ -156,6 +163,7 @@ def delete_instance( if not instance_dir.exists() and not runtime_dir.exists(): return + _emit_step("stopping systemd service (if running)...", on_stdout, passthrough) stop_service( name, on_stdout=on_stdout, @@ -166,6 +174,7 @@ def delete_instance( merged = runtime_dir / "merged" if merged.is_mount(): + _emit_step("unmounting runtime overlay (if mounted)...", on_stdout, passthrough) run_command( ["fusermount3", "-u", str(merged)], on_stdout=on_stdout, @@ -174,7 +183,9 @@ def delete_instance( should_cancel=should_cancel, ) + _emit_step("removing instance files...", on_stdout, passthrough) if instance_dir.exists(): shutil.rmtree(instance_dir) if runtime_dir.exists(): shutil.rmtree(runtime_dir) + _emit_step("delete complete.", on_stdout, passthrough)