I am having a hard time making my systemd script to run in Ubuntu 16.04. Could someone help me checking if I am doing something wrong?
This is the script:
[Unit] Description=TestProject [Service] ExecStart="java -Xmx2048m -Xms512m -jar /opt/project/target/test-dl-1.0.1-SNAPSHOT.jar server /opt/project/src/main/resources/config/config.yml" Restart=always [Install] WantedBy=multi-user.target
And I save it to
/lib/systemd/system/ , then I run
systemctl daemon-reload and then
systemctl enable myservice.service
However, the output I see from
systemctl status myservice.service is:
Aug 17 14:59:17 ubuntu-8gb-sfo2-01 systemd: [/lib/systemd/system/myservice.service:7] Executable path is not absolute, ignoring: Aug 17 14:59:17 ubuntu-8gb-sfo2-01 systemd: myservice.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Are you guys seeing anything wrong that I am doing? Btw, I also tried to not use quotes in the ExecStart part and I get the same error.
Thanks in advance for your help.