diff --git a/src/jlmkr/actions/status.py b/src/jlmkr/actions/status.py new file mode 100644 index 0000000..e3fa570 --- /dev/null +++ b/src/jlmkr/actions/status.py @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers +# +# SPDX-License-Identifier: LGPL-3.0-only + +import subprocess + +from utils.paths import SHORTNAME + + +def status_jail(jail_name, args): + """ + Show the status of the systemd service wrapping the jail with given name. + """ + # Alternatively `machinectl status jail_name` could be used + return subprocess.run( + ["systemctl", "status", f"{SHORTNAME}-{jail_name}", *args] + ).returncode diff --git a/src/jlmkr/donor/jlmkr.py b/src/jlmkr/donor/jlmkr.py index 508dc67..9325280 100755 --- a/src/jlmkr/donor/jlmkr.py +++ b/src/jlmkr/donor/jlmkr.py @@ -142,16 +142,7 @@ from utils.console import eprint, fail from utils.jail_dataset import get_jail_path, get_jail_config_path, get_jail_rootfs_path from actions.exec import exec_jail - - -def status_jail(jail_name, args): - """ - Show the status of the systemd service wrapping the jail with given name. - """ - # Alternatively `machinectl status jail_name` could be used - return subprocess.run( - ["systemctl", "status", f"{SHORTNAME}-{jail_name}", *args] - ).returncode +from actions.status import status_jail def log_jail(jail_name, args):