Extract log action
This commit is contained in:
parent
f29e0bc075
commit
a08149daea
|
@ -0,0 +1,16 @@
|
||||||
|
# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers <https://github.com/Jip-Hop/jailmaker>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from utils.paths import SHORTNAME
|
||||||
|
|
||||||
|
|
||||||
|
def log_jail(jail_name, args):
|
||||||
|
"""
|
||||||
|
Show the log file of the jail with given name.
|
||||||
|
"""
|
||||||
|
return subprocess.run(
|
||||||
|
["journalctl", "-u", f"{SHORTNAME}-{jail_name}", *args]
|
||||||
|
).returncode
|
|
@ -143,17 +143,7 @@ from utils.jail_dataset import get_jail_path, get_jail_config_path, get_jail_roo
|
||||||
|
|
||||||
from actions.exec import exec_jail
|
from actions.exec import exec_jail
|
||||||
from actions.status import status_jail
|
from actions.status import status_jail
|
||||||
|
from actions.log import log_jail
|
||||||
|
|
||||||
def log_jail(jail_name, args):
|
|
||||||
"""
|
|
||||||
Show the log file of the jail with given name.
|
|
||||||
"""
|
|
||||||
return subprocess.run(
|
|
||||||
["journalctl", "-u", f"{SHORTNAME}-{jail_name}", *args]
|
|
||||||
).returncode
|
|
||||||
|
|
||||||
|
|
||||||
from actions.shell import shell_jail
|
from actions.shell import shell_jail
|
||||||
from actions.start import start_jail
|
from actions.start import start_jail
|
||||||
from actions.restart import restart_jail
|
from actions.restart import restart_jail
|
||||||
|
|
Loading…
Reference in New Issue