Move the daemonize function to utils.py
authorIustin Pop <iustin@google.com>
Thu, 10 Apr 2008 14:58:46 +0000 (14:58 +0000)
committerIustin Pop <iustin@google.com>
Thu, 10 Apr 2008 14:58:46 +0000 (14:58 +0000)
commitbd15919630246919bc7c9d8ea42c7b446bb15719
treef150c27269629140fc0ff7a7c8ea4a3124506e0d
parentdac021880a75fad5b1e0a99b427673c80ba90c0e
Move the daemonize function to utils.py

Currently, in ganeti-noded we have the createDaemon function. Since
we'll need the same in other daemons, we move this function to utils.py

With the move, a few changes were also done:
  - change the name to Daemonize()
  - add a parameter, logfile, as different daemons will want to log to
    different files
  - remove the try.. except.. around the fork calls, since they were
    only re-raising the OS exception with less data; unless we want to
    actually handle fork error (not just re-raising), these try blocks
    are not useful
  - change the return style at the end of the function

Reviewed-by: imsnah
daemons/ganeti-noded
lib/utils.py