コード例 #1
0
 def run(self, arg):
     try:
         zdaemon.run((self.script, arg))
     except SystemExit:
         pass
コード例 #2
0
if LOCALE_ID is not None:
    set_locale(LOCALE_ID)


# from this point forward we can use the zope logger

# Import ZServer before we open the database or get at interesting
# application code so that ZServer's asyncore gets to be the
# official one. Also gets SOFTWARE_HOME, INSTANCE_HOME, and CLIENT_HOME
import ZServer

if Zpid and not READ_ONLY:
    import zdaemon, App.FindHomes, posix
    sys.ZMANAGED=1
    
    zdaemon.run(sys.argv, os.path.join(CLIENT_HOME, Zpid))

try:
    # Import logging support
    import zLOG
    import ZLogger

    if READ_ONLY:
        if hasattr(zLOG, '_set_stupid_dest'):
            zLOG._set_stupid_dest(sys.stderr)
        else:
            zLOG._stupid_dest = sys.stderr
    else:
        zLOG.log_write = ZLogger.ZLogger.log_write

    if DETAILED_LOG_FILE:
コード例 #3
0
ファイル: z2s.py プロジェクト: xampserver1/M2Crypto
if os.name == 'posix':
    from Signals import Signals
    Signals.registerZopeSignals()

# Location of the ZServer pid file. When Zope starts up it will write
# its PID to this file.  If Zope is run under zdaemon control, zdaemon
# will write to this pidfile instead of Zope.
PID_FILE=os.path.join(CLIENT_HOME, 'Z2.pid')

if USE_DAEMON and not READ_ONLY:
    import App.FindHomes
    sys.ZMANAGED=1
    # zdaemon.run creates a process which "manages" the actual Zope
    # process (restarts it if it dies).  The management process passes along
    # signals that it receives to its child.
    zdaemon.run(sys.argv, os.path.join(CLIENT_HOME, PID_FILE))

os.chdir(CLIENT_HOME)

def _warn_nobody():
    zLOG.LOG("z2", zLOG.INFO, ("Running Zope as 'nobody' can compromise "
                               "your Zope files; consider using a "
                               "dedicated user account for Zope") )

try:
    # Import logging support
    import zLOG
    import ZLogger

    if READ_ONLY:
        if hasattr(zLOG, '_set_stupid_dest'):
コード例 #4
0
if LOCALE_ID is not None:
    set_locale(LOCALE_ID)

# from this point forward we can use the zope logger

# Import ZServer before we open the database or get at interesting
# application code so that ZServer's asyncore gets to be the
# official one. Also gets SOFTWARE_HOME, INSTANCE_HOME, and CLIENT_HOME
import ZServer

if Zpid and not READ_ONLY:
    import zdaemon, App.FindHomes, posix
    sys.ZMANAGED = 1

    zdaemon.run(sys.argv, os.path.join(CLIENT_HOME, Zpid))

try:
    # Import logging support
    import zLOG
    import ZLogger

    if READ_ONLY:
        if hasattr(zLOG, '_set_stupid_dest'):
            zLOG._set_stupid_dest(sys.stderr)
        else:
            zLOG._stupid_dest = sys.stderr
    else:
        zLOG.log_write = ZLogger.ZLogger.log_write

    if DETAILED_LOG_FILE: