The whole source code is distributed under the terms of the
GNU Public Licence.
-(c) 2003-TODAY, Fabien Pinckaers - OpenERP s.a.
+(c) 2003-TODAY, Fabien Pinckaers - OpenERP SA
"""
import logging
__version__ = openerp.release.version
def check_root_user():
- """ Exit if the process’s user is 'root' (on POSIX system)."""
+ """ Exit if the process's user is 'root' (on POSIX system)."""
if os.name == 'posix':
import pwd
if pwd.getpwuid(os.getuid())[0] == 'root' :
os.unlink(config['pidfile'])
logger = logging.getLogger('server')
logger.info("Initiating shutdown")
- logger.info("Hit CTRL-C again or send a second signal to force the sutdown.")
+ logger.info("Hit CTRL-C again or send a second signal to force the shutdown.")
logging.shutdown()
# manually join() all threads before calling sys.exit() to allow a second signal
config = openerp.tools.config
+ setup_signal_handlers()
+
if config["test_file"]:
run_test_file(config['db_name'], config['test_file'])
sys.exit(0)
import_translation()
sys.exit(0)
+ if not config["stop_after_init"]:
+ # Some module register themselves when they are loaded so we need the
+ # services to be running before loading any registry.
+ start_services()
+
if config['db_name']:
for dbname in config['db_name'].split(','):
preload_registry(dbname)
sys.exit(0)
setup_pid_file()
- setup_signal_handlers()
- start_services()
logger = logging.getLogger('server')
logger.info('OpenERP server is running, waiting for connections...')
quit_on_signals()