Revision 110f49ef lib/utils/process.py

b/lib/utils/process.py
36 36

  
37 37
from ganeti import errors
38 38
from ganeti import constants
39
from ganeti import compat
39 40

  
40 41
from ganeti.utils import retry as utils_retry
41 42
from ganeti.utils import wrapper as utils_wrapper
......
835 836

  
836 837
  @type logfile: str
837 838
  @param logfile: the logfile to which we should redirect stdout/stderr
838
  @rtype: int
839
  @return: the value zero
839
  @rtype: tuple; (int, callable)
840
  @return: File descriptor of pipe(2) which must be closed to notify parent
841
    process and a callable to reopen log files
840 842

  
841 843
  """
842 844
  # pylint: disable-msg=W0212
......
872 874
      rcode = 0
873 875
    os._exit(rcode) # Exit parent of the first child.
874 876

  
875
  SetupDaemonFDs(logfile, None)
876
  return wpipe
877
  reopen_fn = compat.partial(SetupDaemonFDs, logfile, None)
878

  
879
  # Open logs for the first time
880
  reopen_fn()
881

  
882
  return (wpipe, reopen_fn)
877 883

  
878 884

  
879 885
def KillProcess(pid, signal_=signal.SIGTERM, timeout=30,

Also available in: Unified diff