arohner / lein-daemon

A leiningen plugin for daemonizing a clojure process
97 stars 15 forks source link

Placing pidfile outside of project root causes startup to hang #17

Open MaxMartin opened 11 years ago

MaxMartin commented 11 years ago

If you configure your pidfile to be located anywhere outside of the project directory (for instance, /tmp/app.pid), the startup script will hang indefinitely waiting for the pidfile to appear, even though the pidfile has been created correctly.

twashing commented 10 years ago

This is happening to me too ([lein-daemon "0.5.4"]). It occurs even when the pid file is in the project root directory. When I run lein daemon run myapp, I get the following error.

java.lang.Exception: myapp failed to start in 300 seconds
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
    sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:57)
    ...
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)

I've also tried putting it in the background, with lein daemon start myapp &. I think this error has to do with slow JVM startup times. It's also mentioned in this irc log. Any insights here appreciated.

arohner commented 10 years ago

Sorry for the neglect of the project. I'd recommend using https://github.com/circleci/lein-jarbin rather than lein-daemon.