如果改了systemd 服务单元文件需要
sudo systemctl daemon-reload
执行后还需要重启你的systemd 服务
sudo systemctl stop wsChatProject
sudo systemctl start wsChatProject
内容如下:
[Unit]
Description=wsChatProject
After=network.target
[Service]
Type=simple
WorkingDirectory=/root
ExecStart=/root/myapp
Restart=always
User=root
Group=root
[Install]
WantedBy=multi-user.target