I have been running a service (a python script using twistd library) as a non-root user that stays in the background. I've been noticing that it crashes at random times and I want to understand why. As far as I know it doesn't use any specific log file on its own, so can you tell me where I can get more information about what's going on? Either a program/application/event log file or a python-related one?
|
feedback
|
|
If the script does not record any log by itself, this can be accomplished by redirecting standard output and error to a known file at launch. In bash use
The | |||
|
feedback
|
|
I find it useful to always include logging functionality (via the Python Here is the official Python logging doc. Here are some good examples for various types of logging. | |||
|
feedback
|
|
I suspect that it is crashing due to an uncaught Exception somewhere. Try catching and logging the exceptions at the highest level in the script that you can. It may give you some clues. | |||
|
feedback
|
stracehelp? – petrus Dec 31 '11 at 13:49/var/log/messagesand/var/log/syslog. – Khaled Dec 31 '11 at 13:49ps x) after I executed it once, in the other is not. I've been starting it again and again, it seems to run for some hours every time but next day when I login to the system to check it's not there anymore. – Ion Dec 31 '11 at 14:02