ns8:app_container_ctrl:app_container_ctrl

Apps & container control

In the below commands, '<module_id>' should be replaced with with real app name and number. All commands must be run as root.

runagent command and options
usage: runagent [-h] [-l | -m MODULE_ID] [-c] [COMMAND] ...

Run COMMAND in the agent environment of MODULE_ID

positional arguments:
  COMMAND               Command to run in the agent environment
  ARGS                  Additional arguments for COMMAND

options:
  -h, --help            show this help message and exit
  -l, --list-modules    List running modules
  -m MODULE_ID, --module-id MODULE_ID
                        MODULE_ID, a module identifier (e.g. "module1", "node"). Default is "cluster". Only root can use this flag
  -c, --current-dir     Run COMMAND in current directory, instead of changing directory to AGENT_STATE_DIR
runagent -m <moduleid> systemctl --user [status|start|stop|restart|try-reload-or-restart|(enable|disable --now)] <servicename>

source

Restart an app
runagent -m <module_id> systemctl --user restart <servicename>

e.g.:

runagent -m traefik1 systemctl --user restart traefik
Show all running services in the container
runagent -m <module_id>

then

systemctl --user --type=service --state=running
Check if an app is running
runagent -m <module_id> podman ps
Stop an app
runagent -m <module_id> systemctl --user stop <module_id>
Restart an app
runagent -m <module_id> systemctl --user restart <module_id>
Show running app containers
runagent -m <module_id> podman ps
show running app sate directory
runagent -m <module_id> ls -l
Check MODULE_ID of an app
runagent -m <module_id> grep MODULE_ID environment

Remove an app
remove-module --help
usage: remove-module [-h] [--no-preserve] [--force] module

positional arguments:
  module

options:
  -h, --help     show this help message and exit
  --no-preserve  erase also the module home directory
  --force        unconditionally erase the module from Redis (dangerous)

Example:

remove-module --no-preserve --force <module_id>
  • ns8/app_container_ctrl/app_container_ctrl.txt
  • Last modified: 15 months ago
  • by LayLow