0

I use the script of PbxMan to run a Java app as a service on this answer.

All work perfectly when I launch my app in terminal but when it's running as a service, external commands are not executed.

Example of how I execute commands :

String [] startStreamWCTour = {
        "/usr/local/bin/mjpg_streamer",
        "-i", "/usr/local/lib/input_uvc.so -f 10r VGA",
        "-o", "/usr/local/lib/output_http.so -w /var/www/cam"};
Process p = Runtime.getRuntime().exec( startStreamWCTour );
...

and nothing is executed...

Maybe I have to add something to my commands...? ( I'm a little newbish on Linux ;) )

Community
  • 1
  • 1
DFaze
  • 21
  • 6
  • What is the `Process`'s exit code? Does it print anything in its error stream? – John Kugelman Oct 16 '15 at 17:58
  • i used to echo the output... i'll implement a log file. Thanks for your quick response – DFaze Oct 16 '15 at 18:05
  • ok nevermind, the app was crashing an exception ... now the problem is another ... app start then shut down, i'll open a new thread for this question. I thought PbxMan's script solve it but not... – DFaze Oct 16 '15 at 18:36
  • See also [When Runtime.exec() won't](http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html) for many good tips on creating and handling a process correctly. Then ignore it refers to `exec` and use a `ProcessBuilder` to create the process. – Andrew Thompson Oct 17 '15 at 16:02
  • Yes thanks Andrew, I have seen this article quite usefull! But today I don't want to reimplement something who work good. My problem is solved but an other come : http://stackoverflow.com/q/33178619/5066919 – DFaze Oct 17 '15 at 19:52

0 Answers0