nós temos um script systemd simples para iniciar um servidor MineCraft de uma maneira de serviço. O SO é o CentOS 7. Aqui está o script:
[Unit]
Description=Minecraft Server
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/root/Minecraft
ExecStart=/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Restart=on-failure
[Install]
WantedBy=multi-user.target
Iniciar o serviço funciona bem, mas ao parar, o serviço permanece em um estado com falha. Vejo:
systemctl status minecraftd.service
minecraftd.service - Minecraft Server
Loaded: loaded (/usr/lib/systemd/system/minecraftd.service; disabled)
Active: active (running) since Mon 2015-06-01 16:00:12 UTC; 18s ago
Main PID: 20975 (java)
CGroup: /system.slice/minecraftd.service
└─20975 /bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
systemctl stop minecraftd.service
systemctl status minecraftd.service
minecraftd.service - Minecraft Server
Loaded: loaded (/usr/lib/systemd/system/minecraftd.service; disabled)
Active: failed (Result: exit-code) since Mon 2015-06-01 16:01:37 UTC; 3s ago
Process: 20975 ExecStart=/bin/java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui (code=exited, status=143)
Main PID: 20975 (code=exited, status=143)
Qualquer ideia?
obrigado