How do I debug a Daemonise Problem.

I’m looking for some advice on how to track down a problem in my stand alone Web app. It’s running on a Raspberry Pi. It uses GPIO and the Pi camera so I can’t meaningfully run it on any other platform.

The problem is that it runs without a problem in the remote debugger or when I build it and deploy it to a Pi undaemonised. However, when it’s daemonised it starts to run successfully but then suddenly crashes but writes nothing to the syslog to tell me what the error was.

So, how do I go about finding the problem? Is there somewhere else it might be writing an error message or something I can do to trap it? It’s not a huge program but large enough to be fairly tedious if I have to write debug syslog entries all over it just to track down where it is falling over?

Any ideas?