I've wrapped a jar in a init.d service following the guide here.
- created the service file under
- give proper permissions
- test the stop and start:
sudo service myservice start/stop/restart;
The process is starting after the
sudo service myservice start and I can see it from the command
ps -ef | grep -i myservice
However the service should log its execution in a logging file in the same path of the jar, but this logging file is not created.
Instead, If the jar is executed through
java -jar myJar.jar & and not within the service the log file is created.
How is it possible?