49 lines
985 B
Plaintext
49 lines
985 B
Plaintext
# 给安装脚本执行权限
|
||
chmod +x install_service.sh
|
||
|
||
# 运行安装脚本(需要root权限)
|
||
sudo bash install_service.sh
|
||
# 查看服务状态
|
||
systemctl status bjh_daemon
|
||
|
||
# 查看实时日志
|
||
journalctl -u bjh_daemon -f
|
||
|
||
# 查看最近50行日志
|
||
journalctl -u bjh_daemon -n 50
|
||
|
||
# 停止服务
|
||
systemctl stop bjh_daemon
|
||
|
||
# 启动服务
|
||
systemctl start bjh_daemon
|
||
|
||
# 重启服务
|
||
systemctl restart bjh_daemon
|
||
|
||
# 禁用开机自启
|
||
systemctl disable bjh_daemon
|
||
|
||
# 启用开机自启
|
||
systemctl enable bjh_daemon
|
||
# 1. 检查服务是否运行
|
||
systemctl is-active bjh_daemon
|
||
# 输出 "active" 表示正在运行
|
||
|
||
# 2. 查看进程
|
||
ps aux | grep data_sync_daemon
|
||
|
||
# 3. 查看日志输出
|
||
tail -f logs/bjh_daemon.log
|
||
# 查看详细错误日志
|
||
journalctl -u bjh_daemon -n 100 --no-pager
|
||
|
||
# 检查Python路径是否正确
|
||
which python3
|
||
|
||
# 检查脚本是否存在
|
||
ls -la /root/xhh_baijiahao/data_sync_daemon.py
|
||
|
||
# 手动运行测试
|
||
cd /root/xhh_baijiahao
|
||
python3 data_sync_daemon.py |