Ñò Ê|¾Mc @s#dZdZdZdZdZddkZddkZddkZdZei Z ei Z e edƒo ei Z nd Z d „Zed joŒeƒZd eeiƒeiƒeiƒeidƒeiƒeiƒeiƒeiƒf Zed dƒiedƒeieƒndS(sDisk And Execution MONitor (Daemon) Configurable daemon behaviors: 1.) The current working directory set to the "/" directory. 2.) The current file creation mode mask set to 0. 3.) Close all open files (1024). 4.) Redirect standard I/O streams to "/dev/null". A failed call to fork() now raises an exception. References: 1) Advanced Programming in the Unix Environment: W. Richard Stevens 2) Unix Programming Frequently Asked Questions: http://www.erlenstar.demon.co.uk/unix/faq_toc.html sChad J. Schroeders$Copyright (C) 2005 Chad J. Schroeders$Id$s0.2iÿÿÿÿNitdevnulls /dev/nullc Cs–ytiƒ}Wn.tj o"}td|i|if‚nX|djo‡tiƒytiƒ}Wn.tj o"}td|i|if‚nX|djotitƒti t ƒqâti dƒnti dƒddk }|i |iƒd}||ijo t}nx>td|ƒD]-}yti|ƒWq.tj oq.Xq.WtittiƒtiddƒtiddƒdS(s_Detach a process from the controlling terminal and run it in the background as a daemon. s%s [%d]iiÿÿÿÿNii(tostforktOSErrort ExceptiontstrerrorterrnotsetsidtchdirtWORKDIRtumasktUMASKt_exittresourcet getrlimitt RLIMIT_NOFILEt RLIM_INFINITYtMAXFDtrangetclosetopent REDIRECT_TOtO_RDWRtdup2(tpidteR tmaxfdtfd((s=/home/olivier/project/pgsql/contrib/openBarter/cron/daemon.pyt createDaemon0s:         t__main__sÌ return code = %s process ID = %s parent process ID = %s process group ID = %s session ID = %s user ID = %s effective user ID = %s real group ID = %s effective group ID = %s screateDaemon.logtws (t__doc__t __author__t __copyright__t __revision__t __version__RtsystsettingsR R RthasattrRRRt__name__tretCodetgetpidtgetppidtgetpgrptgetsidtgetuidtgeteuidtgetgidtgetegidt procParamsRtwritetexit(((s=/home/olivier/project/pgsql/contrib/openBarter/cron/daemon.pyts(       ‰  -+