Bonjour,
Je tente de convertir le script de démarrage sous systemd. Mais pas beaucoup de doc à ce sujet en français.
Ancien fichier :
!/bin/sh
USER=“teamspeak"
DIR=”/usr/local/teamspeak/teamspeak3-server_linux-x86"case “$1” in
start)
su $USER -c “/usr/bin/exagear – ${DIR}/ts3server_startscript.sh start”
;;
stop)
su $USER -c “/usr/bin/exagear – ${DIR}/ts3server_startscript.sh stop”
;;
restart)
su $USER -c “/usr/bin/exagear – ${DIR}/ts3server_startscript.sh restart”
;;
status)
su $USER -c “/usr/bin/exagear – ${DIR}/ts3server_startscript.sh status”
;;
*)
echo “Usage: {start|stop|restart|status}” >&2
exit 1
;;
esac
exit 0
Nouveau :
[Unit]
Description=TeamSpeak 3 Server
After=network.target
[Service]
WorkingDirectory=/usr/local/teamspeak/teamspeak3-server_linux-x86/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/usr/bin/exagear – /usr/local/teamspeak/teamspeak3-server_linux-x86/ts3server_startscript.sh start
ExecStop=/usr/bin/exagear – /usr/local/teamspeak/teamspeak3-server_linux-x86/ts3server_startscript.sh stop
ExecReload=/usr/bin/exagear – /usr/local/teamspeak/teamspeak3-server_linux-x86/ts3server_startscript.sh restart
PIDFile=/usr/local/teamspeak/teamspeak3-server_linux-x86/ts3server.pid
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
Une âme charitable peut me dire si la syntaxe est bonne?
Merci d’avance,
Alexis