I have this 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 I do this, I get this error
start-stop-daemon: unable to stat /usr/bin/java -jar /home/username/myjar.jar (No such file or directory)
If I do
/usr/bin/java -jar /home/username/myjar.jar
everything is ok on the command line .. I'm not mistaken :(
Try the following:
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$NAME.pid \ --background \ --exec /usr/bin/java -- -jar /home/username/myjar.jar
It seems you need to separate the executable (here /usr/bin/java from its argument with -- .
/usr/bin/java
--
(oh, also change uid to the corresponding user, root not required)
root
Source: https://habr.com/ru/post/1208092/More articles:CIAreaHistogram gives me all 0 except the last element? - objective-csymfony2 form, collection of objects, release of updating an existing property of an object - phpIIS URL Redirection Redirected - url-rewritingHow to reduce caption size in all numbers - latexHow to depend on all * compilation and * testCompile tasks in Gradle - javahive-site.xml path in hive0.13.1 - hivehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1208094/psd-pixels-to-ios-points&usg=ALkJrhg1kHy-UYcGwb8eqvC53PmtAr_ZHgHow to use django-scheduler application in an existing application - pythonDisplay warning from application delegate before display warning from viewDidload - iosException in thread "main" java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getPointerSize () I - javaAll Articles