Service-Based Deployment and Upgrade
After registering clmBot as a system service, the clmBot server can run persistently and start automatically with the system, making it suitable for servers using the cloud push method. This page also introduces hot reloading of configuration, runtime logs, and client upgrades.
Register as a System Service
Prerequisite: You have completed the login integration according to Quick Start.
Run the following command to register the clmBot server as a system service:
./clm-bot-linux-amd64 server --service install -a="0.0.0.0:8862"
Registration notes:
- On Linux, it is registered as a systemd service; on Windows, it is registered as a Windows service with the same name. Both support starting automatically on boot.
- The service name is
ssltrus-clm-bot-<节点ID>-<端口>, and the node ID is the clmBot ID assigned during onboarding. - The service runs according to the configuration file and listening address specified at installation, with the working directory set to the directory containing the configuration file.
To install the service as the currently logged-in user (rather than at the system level), add the --user parameter.
Managing the service
Manage the service through server --service <动作>:
./clm-bot-linux-amd64 server --service status # 查看服务状态
./clm-bot-linux-amd64 server --service start # 启动服务
./clm-bot-linux-amd64 server --service stop # 停止服务
./clm-bot-linux-amd64 server --service restart # 重启服务
./clm-bot-linux-amd64 server --service uninstall # 卸载服务(卸载前自动停止)
Configuration Hot Reloading
The clmBot server enables configuration hot reloading by default (--watch, enabled by default): after modifying config.yaml, the configuration is automatically reloaded without restarting the service.
To disable hot reloading, you can explicitly specify --watch=false at startup.
Viewing Runtime Logs
clmBot runtime logs are located in logs/clm-bot.log under the directory where the configuration file resides, and console output is also recorded to this file.
Log files rotate automatically:
- A single log file is up to 30MB.
- Logs from the last 90 days are retained.
- Up to 10 backup files are kept.
Upgrading clmBot
Run the following command to check for and upgrade to the latest version:
./clm-bot-linux-amd64 update
After execution, clmBot checks the latest version of the current platform from the official release source:
- When already on the latest version, it outputs the current version number and skips.
- When a new version is available, it automatically downloads and verifies file integrity (SHA-256), then replaces the current executable.
View the current client version:
./clm-bot-linux-amd64 --version
After the upgrade is complete, if clmBot is running as a system service, run server --service restart to make the new version take effect.
Windows built-in command terminal
On Windows servers, running the clmBot executable directly without parameters opens the built-in command terminal. This terminal can only execute clmBot subcommands. Enter help to view commands, and enter exit to exit. It is suitable for use in restricted operations environments.