Как известно, сервер для Quake II нуждается в периодическом рестарте:
One thing to keep in mind is that the server must be restarted at least every 49 days, because the Quake II network protocol represents the interal time as a 32 bit integer and after 49 days that integer overflows, leading to all kinds of trouble.
This problem has always existed in Quake II and is not fixable (at least not without breaking compatibility with the existing network protocol), but back in Win9x days this was less of a problem because Windows crashed frequently anyways and Win9x had the same bug and crashed after 49 days or so...
Как это можно сделать красиво?
Я сделал через crontab
, вроде такого:
0 0 1 * * /usr/bin/systemctl restart q2ded
Но интересует, существуют ли более элегантные решения?
ENV: CentOS 7, systemd 219.
q2ded.service:
[Unit]
Description=Quake II Server
Wants=network-online.target
After=network.target network-online.target
[Service]
User=opc
WorkingDirectory=/srv/quake2
ExecStart=/usr/bin/stdbuf -i0 -o0 -e0 /srv/quake2/q2ded
StandardOutput=journal
StandardError=journal
SyslogIdentifier=q2ded
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target