Closed jjlauer closed 12 years ago
Servers shouldn't write to stdout. The error should be in the error log.
On Wed, Oct 19, 2011 at 9:15 PM, Joe Lauer < reply@reply.github.com>wrote:
On my Ubuntu machine, I tried running the following command:
java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar
Kestrel would fail to start and not print out any sort of error to my console. Since Kestrel writes to /var/run, /var/log, etc. and the user I was attempting to run it under didn't have permissions, Kestrel failed to start. That makes sense, but I didn't expect that to happen silently. The only way to get around this is to run via sudo:
sudo java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar
Reply to this email directly or view it on GitHub: https://github.com/robey/kestrel/issues/74
That's the problem though -- without valid permissions an error wasn't able to be printed out to a log. By default, /var/log/kestrel wasn't writable by my default account. Any errors prior to the valid opening up of a logfile should be printed out to at least stderr, otherwise its a mystery why it failed to start.
Writing to stderr seems appropriate, in the case where the error is related to not being able to create a log file to write to, and especially when it's a fatal error. A coworker just ran into this. Silent failure is difficult to troubleshoot.
ok, the version on head should now dump errors to stdout if the server isn't capable of starting (either because of a missing config file, or a broken queue folder).
On my Ubuntu machine, I tried running the following command:
java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar
Kestrel would fail to start and not print out any sort of error to my console. Since Kestrel writes to /var/run, /var/log, etc. and the user I was attempting to run it under didn't have permissions, Kestrel failed to start. That makes sense, but I didn't expect that to happen silently. The only way to get around this is to run via sudo:
sudo java -server -Dstage=development -jar ./dist/kestrel/kestrel-2.1.3.jar