Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#32 Posix: apppid of spawned process is not written

All
closed-fixed
nobody
None
5
2013-12-20
2011-05-21
Thomas
No

Hi I rely on proper shutdown of the spawned process, but looking at the code I see it getting started with Runtime.exec in PosixService startProcess and no pid gets written to disk. So it cannot be properly stopped (appid is always -1 at my side). I see that the pidfile config is hardcoded. How would be a nice way to fix that ? Ididn't see how it gets stopped right now, but my shutdownhooks are not beeing called and thats a showstopper.

Discussion

1 2 3 > >> (Page 1 of 3)
  • rzo
    rzo
    2011-05-21

    hello,

    what OS are you running on ? yajsw version ? jvm ?
    note that pid file is created in the init method of PosixService

    i tested it again on ubuntu and the pid file is generated correctly. please note that you have to execute installDaemon and startDaemon has admin, otherwise you have may have the required user rights to access the etc and var/run folders.

    -- Ron

     
  • Thomas
    Thomas
    2011-05-21

    I'm running on debian with OpenJDK 6, tried alse sun6, yajsw 10.6. I see the file should be written in postStart(). I tried to configure wrapper.java.pidfile but in /var/run I see only the pid of the wrapper process. There should be two files. However when I launch with -c (pidfile also missing) the spawned process gets terminated (I don't see how, because I'm running in console?) if I start with the script the spawned process gets terminated sometimes (not always) but his shutdownhooks are never executed. That what I see so far. Let me know how I can help.

     
  • Thomas
    Thomas
    2011-05-21

    I tried with 10.7:
    s15447269:/opt/mango# /etc/init.d/buchmanager stop
    Stopping buchmanager ...
    May 21, 2011 5:22:02 PM org.apache.commons.vfs.VfsLog info
    INFO: Using "/tmp/vfs_cache" as temporary files store.
    May 21, 2011 5:22:02 PM org.rzo.yajsw.os.posix.PosixService init
    INFO: /etc/init.d/buchmanager already exists
    ************* STOPPING buchmanager ***********************

    May 21, 2011 5:22:03 PM org.rzo.yajsw.os.posix.PosixService getPid
    INFO: wrapper pid file: /var/run/wrapper.buchmanager.pid
    May 21, 2011 5:22:03 PM org.rzo.yajsw.os.posix.PosixService stopProcess
    INFO: stop daemon with pid 3887
    rudi 0
    May 21, 2011 5:22:04 PM org.rzo.yajsw.os.posix.PosixService getAppPid
    INFO: app pid file: /var/run/wrapper.java.buchmanager.pid
    May 21, 2011 5:22:04 PM org.rzo.yajsw.os.posix.PosixService stopProcess
    INFO: stop daemon app with pid -1
    May 21, 2011 5:22:04 PM org.rzo.yajsw.os.posix.PosixService getPid
    INFO: wrapper pid file: /var/run/wrapper.buchmanager.pid
    Service buchmanager stopped

     
  • Thomas
    Thomas
    2011-05-21

    I fail to set the loglevel to debug. Is there any trick with that ?

     
  • Thomas
    Thomas
    2011-05-23

    Sorry for spamming, but I could need some assistance. I set the loglevel to DEBUG but still only get INFO msgs. And on the other hand I don't get any logfile output even though I enabled it. I'll try to attach my config and really hope that you assist me. I could debug the problem on wednesday.

     
  • Thomas
    Thomas
    2011-05-23

     
    Attachments
  • rzo
    rzo
    2011-05-23

    hello,

    you are not spamming, sorry on my side for not being able to respond earlier.

    currently yajsw is set to log only INFO loggings. to get more information you can set in the configuration file:

    wrapper.debug = true

    this will log some more details.

    pls post your configuration, so that i may see what is going on.
    generally a log file is generated. if none is generated, then you may have either some wrong configuration, or no user rights to create the log file at the configured location.

    what OS are you running on ?

    yes, it is correct, that you should have both pid files, but, before we should be able to get it to run as console using runConsole.sh and we should have a log file.

    -- Ron

     
  • rzo
    rzo
    2011-05-23

    ps: sorry, did not see that you have attached the log file.

     
  • rzo
    rzo
    2011-05-23

    concerning the configuration:
    try the following:

    wrapper.working.dir=<absolute path to the working dir>

    wrapper.java.app.jar=monitor.jar

    where is monitor.jar ? in the working dir above ?

    wrapper.java.classpath.1=service/lib/core/groovy/groovy-all-1.7.7.jar

    is this path relative to the working dir ?

    pls set:

    wrapper.console.loglevel=INFO
    wrapper.logfile.loglevel=INFO
    wrapper.logfile.maxsize=10m

    we should first get your process to run correctly, then we could try to change the configration to your needs.

    -- Ron

    -- Ron

     
  • Thomas
    Thomas
    2011-05-24

    HI I attached my config as a file. I tried setting wrapper.debug to true but still only info msgs. No log file. I deployed all libs except the groovy folder. maybe I am missing something important?

     
1 2 3 > >> (Page 1 of 3)