From ce0d83c2813085a4a9bb6c1c19e7b17e4faf6fe2 Mon Sep 17 00:00:00 2001 From: Tony Tran Date: Fri, 3 Jul 2026 22:02:17 +0700 Subject: [PATCH] Update usage-dashboard/README.md --- usage-dashboard/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/usage-dashboard/README.md b/usage-dashboard/README.md index e295c16..35ed63b 100644 --- a/usage-dashboard/README.md +++ b/usage-dashboard/README.md @@ -110,32 +110,38 @@ pkill -f usage-dashboard.py ### Chạy như systemd service -Tạo file `/etc/systemd/system/cliproxy-dashboard.service`: +Tạo file `~/.config/systemd/user/cliproxy-dashboard.service`: ```ini [Unit] Description=CLIProxyAPI Usage Dashboard -After=network.target +# Added cliproxyapi.service to After= to ensure it starts AFTER the API +After=network.target cliproxyapi.service +# Requires= means if the API stops, this dashboard will also stop. +# If you want the dashboard to stay running even if the API crashes temporarily, +# change Requires= to Wants= +Requires=cliproxyapi.service [Service] Type=simple -User=admin WorkingDirectory=/home/admin/cliproxyapi/usage-dashboard ExecStart=/usr/bin/python3 /home/admin/cliproxyapi/usage-dashboard/usage-dashboard.py start --no-browser Restart=always RestartSec=10 [Install] -WantedBy=multi-user.target +# Changed to default.target for user services +WantedBy=default.target + ``` Kích hoạt service: ```bash -sudo systemctl daemon-reload -sudo systemctl enable cliproxy-dashboard -sudo systemctl start cliproxy-dashboard -sudo systemctl status cliproxy-dashboard +sudo systemctl --user daemon-reload +sudo systemctl --user enable cliproxy-dashboard +sudo systemctl --user start cliproxy-dashboard +sudo systemctl --user status cliproxy-dashboard ``` ## 📖 Hướng dẫn sử dụng Dashboard