On May 23, 2005, at 10:11 PM, Darren Gibbs wrote:
> On May 23, 2005, at 6:39 PM, Dave Hylands wrote:
>>> Just to be entertaining, it seems like it's not as black and
>>> white as
>>> I at first thought... it's working sometimes... 8/10 times
>>> is fine, 2/10 times ttyS0 isn't taking input, but everything else is
>>> fine. So far this only happens when the ports are configured and
>>> app is launched by an init script. Launching the app by hand
>>> (without changing the port configurations) seems to work everytime.
>> Yep - that's definitely weird. The other difference between running
>> from init.d and when running from a shell, is who your parent process
>> is, and where stdin/stdout is directed.
>> I think that programs launched from init will have stdin and stdout
>> set to /dev/console.
> Now that I have the signal handler in place I used the launch
> script to redirect my app's stdout/stderr to a log file in /tmp.
> If things aren't working I can log in and kill the app with 'kill
> -1" and then read the log. Remarkably, now that I have the debug
> mechanism in place, I can't get the app to fail again!
I had a similar experience trying to figure out why sdpd iirc (part
of the bluetooth utils) wasn't running properly from the startup
script, but would run fine from command line. I don't think I did
ever figure out what the problem was, but adding a sleep at the
appropriate time I think cured it.