1

I am creating a daemon process which monitors loads on database. The process is created using the reference of code at http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/

What I am trying to do is:

  1. Call the createDaemon() method defined in the function on above link.
  2. Call the function monitor_load() after calling above mentioned function. This function is defined in the same script.

Inside monitor_load(), I call python logging module to log all information in a log file.

I understand that while creating daemon, the code is redirecting all STDOUT, STDIN, STDERR to /dev/null, but I do not want that to happen. I want all logging to happen properly from inside the daemon process.

Any idea how I can accomplish that?

Thanks.

Priyesh
  • 415
  • 3
  • 11

1 Answers1

1

Found out the solution. Just needed to close only STDIN, STDOUT and STDERR of parent process. The code was closing all. Thanks for looking into it Benjamin

Priyesh
  • 415
  • 3
  • 11