service - Debian start-stop-daemon. Java start jar File -
i have command in shellscript in /etc/init.d/
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$name.pid --background --exec /usr/bin/java -jar /home/username/myjar.jar
if execute error
start-stop-daemon: unable stat /usr/bin/java -jar /home/username/myjar.jar (no such file or directory)
if execute
/usr/bin/java -jar /home/username/myjar.jar
in commandline fine .. don't mistake :(
try this:
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$name.pid \ --background \ --exec /usr/bin/java -- -jar /home/username/myjar.jar
it seems need separate executable (here /usr/bin/java
argument --
.
(oh, change uid appropriate user; root
should not required)
Comments
Post a Comment