Keeping GUI alive - Sjakil/gunthy-gui GitHub Wiki
In order to keep your GUI alive without having an open console or application window, you can use PM2. This is the easiest way to do so, as the GUI already uses PM2 to run your bots in the background. If you haven't installed it yet, visit the "Install PM2" section for instructions.
Starting the GUI is fairly straight-forward. Navigate to your Gunbot folder and execute following command:
pm2 start gunthy-gui-linux-x64
- Replace executable name corresponding to your OS
- Use full path wherever applicable (for example in startup or crontab script)
Stopping the process works in an identical way.
pm2 stop gunthy-gui-linux-x64
You can check the status of your processes (including your bots) as well.
pm2 list
If you use GUI version 0.96 or higher, it is very probable that the GUI will not work correctly if it uses a daemon spawned by itself. Please make sure that you reset the PM2 daemon at least once before starting the GUI using PM2. You can use the commands below (this will also stop any running processes, including bots, managed by PM2).
pm2 kill
pm2 ping
For reference, these are the available commands (on version 2.4.5).
Options:
-h, --help output usage information
-V, --version output the version number
-v --version get version
-s --silent hide all messages
-m --mini-list display a compacted list without formatting
-f --force force actions
-n --name <name> set a <name> for script
-i --instances <number> launch [number] instances (for networked app)(load balanced)
-l --log [path] specify entire log file (error and out are both included)
-o --output <path> specify out log file
-e --error <path> specify error log file
-p --pid <pid> specify pid file
--max-memory-restart <memory> specify max memory amount used to autorestart (in megaoctets)
--env <environment_name> specify environment to get specific env variables (for JSON declaration)
-x --execute-command execute a program using fork system
-u --user <username> define user when generating startup script
-c --cron <cron_pattern> restart a running process based on a cron pattern
-w --write write configuration in local folder
--interpreter <interpreter> the interpreter pm2 should use for executing app (bash, python...)
--log-date-format <momentjs format> add custom prefix timestamp to logs
--no-daemon run pm2 daemon in the foreground if it doesn't exist already
--merge-logs merge logs from different instances but keep error and out separated
--watch watch application folder for changes
--ignore-watch <folders|files> folder/files to be ignored watching, chould be a specific name or regex - e.g. --ignore-watch="test node_modules "some scripts""
--node-args <node_args> space delimited arguments to pass to node in cluster mode - e.g. --node-args="--debug=7001 --trace-deprecation"
--no-color skip colors
--no-vizion skip vizion features (versioning control)
--no-autorestart do not automatically restart apps