Estou tentando executar um script de shell do systemd. O script funciona bem na linha de comando.
O script (runServer.sh), executa um processo Java e fica assim:
#!/bin/bash
java -jar -Dresources=/home/pruss/dev/ServerDeploy5-4.1/Server/resources/MyServer.jar "0" "Test"
Dentro /usr/lib/systemd/system
(ou /lib/systemd/system/
em outros sistemas operacionais), criei um arquivo de serviço (myService.service):
[Unit]
Description=My Servers service
[Service]
ExecStart=/home/pruss/dev/ServerDeploy5-4.1/Server/runServer.sh
User=root
Type=oneshot
[Install]
WantedBy=multi-user.target
O resultado
Job for myService.service failed. See "systemctl status myService.service" and "journalctl -xn" for details.
Eu tento:
systemctl status myService.service
Loaded: loaded (/usr/lib/systemd/system/myService.service; disabled)
Active: failed (Result: exit-code) since Thu 2015-07-23 12:27:38 BST; 26s ago
Main PID: 28413 (code=exited, status=203/EXEC)