3

I'm trying to reproduce the code written in this post:

How to convert a java program to daemon with jsvc?

Without the fancy bash script.

I created the jar. This is the command I'm running:

jsvc -verbose -outfile tmp/example.out -cp /pathto/commons-daemon-1.0.13/commons-daemon-1.0.13.jar:/pathto/MyProject.jar my.package.MyClass

Now... This does absolutely nothing. No output whatsoever. I even tried it with the script. No output again. And since jsvc doesn't throw any kind of error at all I have no clue what the problem is.

I even tried running it with -server or with sudo. Then I can see it appearing under processes but it still does nothing. Also verbose doesn't do anything and JAVA_HOME is properly configured.

Any clues / ideas? Did anybody make this work under OSX at all ever?

EDIT:

Logging is system out which according to that post and the manual of jscv should be captured in outfile.

Yes I did try setting an error file. Again no luck there was nothing in it it wasn't even created.

I tried giving it a user. And the code is exactly the same as in the linked issue that's why I didn't clutter this ticket with it.

I compiled my jsvc and have no tomcat installed.

Community
  • 1
  • 1
Hannibal
  • 1,078
  • 2
  • 12
  • 24
  • No output in the example.out file, you mean? Did you try setting an error file? How is logging configured? I suspect you'll need to supply more information. – Dave Newton Feb 22 '13 at 00:19

2 Answers2

2

Have you tried running with the -debug flag? It spits out a fairly amount of useful information about why things may not be running as anticipated.

nullPainter
  • 2,676
  • 3
  • 22
  • 42
2

In my case it worked to set -outfile and-errfile to standard out and standard error. Try:

-outfile '&1' -errfile '&2'
dhfsk
  • 281
  • 1
  • 8