我最近將我的伺服器從虛擬機器移至新機器。
從那時起,我有時會遇到莫名其妙的事件,即在關閉以運行服務的用戶身份登入的sftp / ssh 的最後一個打開的會話時,我的Teamspeak Server 停止(並且自動重新啟動,因為這就是我配置它的方式)。
所以基本上,當關閉最後一個開啟的 ssh 連線時,我的 linux 會向我的 TS3 伺服器發送終止訊號。這是崩潰時的journalctl日誌:
Jun 30 10:48:03 ubuntu-server ts3server_startscript.sh[7505]: Starting the TeamSpeak 3 server
Jun 30 10:51:30 ubuntu-server systemd[1]: teamspeak.service: Control process exited, code=exited status=203
Jun 30 10:51:30 ubuntu-server systemd[1]: teamspeak.service: Unit entered failed state.
Jun 30 10:51:30 ubuntu-server systemd[1]: teamspeak.service: Failed with result 'exit-code'.
Jun 30 10:51:33 ubuntu-server systemd[1]: teamspeak.service: Service hold-off time over, scheduling restart.
我使用以下 SystemD 配置:
[Unit]
Description=TeamSpeak 3 Server
After=network.target
[Service]
WorkingDirectory=/home/teamspeak/teamspeak3-server_linux_amd64/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/teamspeak3-server_inux_amd64/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/teamspeak3-server_linux_amd64/ts3server.pid
RestartSec=3
Restart=always
[Install]
WantedBy=multi-user.target
有任何想法嗎?我無法解釋它..