Task - We have to run only one instance that is through wsgi server.
We are executing two instance for Odoo Application, one is working through wsgi server and second is working through default odoo server. But wsgi server not able to run scheduler or cron and also not showing standard error of odoo application only showing standard console with access files and print statements.
Both WSGI.ini and WSGI.py files pasted here, correct me if anything wrong -
WSGI.py
# WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py
#
# For gunicorn additional globals need to be defined in the Gunicorn section.
# Then the following command should run:
# $ gunicorn odoo:service.wsgi_server.application -c openerp-wsgi.py
#import newrelic.agent
#newrelic.agent.initialize('/etc/newrelic.ini')
import odoo
from odoo.service.server import ThreadedServer
#----------------------------------------------------------
# Common
#----------------------------------------------------------
odoo.multi_process = True # Nah!
# Equivalent of --load command-line option
odoo.conf.server_wide_modules = ['web']
conf = odoo.tools.config
# Path to the OpenERP Addons repository (comma-separated for
# multiple locations)
conf['addons_path'] = '/home/odoo/newerp/odoo/addons,/home/odoo/newerp/odoo/odoo/addons,/home/odoo/newerp/addtional_module'
conf['logfile'] = '/var/log/odoo/odoo-server.log'
# Optional database config if not using local socket
conf['db_name'] = 'test'
conf['db_host'] = 'localhost'
conf['db_user'] = 'odoo'
conf['db_port'] = '5432'
conf['db_password'] = 'admin'
conf['dbfilter'] = 'test'
conf['max_cron_threads'] = '2'
conf['logrotate'] = 'True'
conf['log_handler'] = "[':INFO']"
conf['log_level'] = 'info'
#conf['syslog']= True
#conf['log_db'] = False
#conf['log_db_level'] = 'warning'
conf['new_relic_config_file'] = '/etc/newrelic.ini'
#----------------------------------------------------------
# Generic WSGI handlers application
#----------------------------------------------------------
application = odoo.service.wsgi_server.application
odoo.service.server.load_server_wide_modules()
ThreadedServer(None).cron_spawn()
#Configure Cron Job
#from odoo.service.server import ThreadedServer
#ThreadedServer(None).cron_spawn()
#----------------------------------------------------------
# Gunicorn
#----------------------------------------------------------
# Standard OpenERP XML-RPC port is 8069
#bind = '127.0.0.1:8069'
#pidfile = '.gunicorn.pid'
#workers = 4
#timeout = 240
#max_requests = 2000
WSGI.ini
[uwsgi]
uid=odoo
gid=odoo
plugin = python
pythonpath = /home/odoo/newerp/odoo/
#/home/odoo/odoo/odoo/odoo/
#env = OPENERP_CONFIGRC=/home/odoo/newerp/odoo/odoo.conf
env = HOME=/home/odoo
env = NEW_RELIC_CONFIG_FILE=/etc/newrelic.ini
env = log_handler=[':DEBUG']
env = log_level = info
env = logfile = /var/log/odoo/odoo-server.log
env = log_db = False
wsgi-file = /home/odoo/newerp/odoo/odoo-wsgi.py
#processes = 4
#threads = 2
#memory-report = true
#daemonize = /var/log/odoo/odoo-server.log
#die-on-term = true
#emperor = true
enable-threads = true
single-interpreter = true
master = true
vacuum = true
processes = 10
#threads = 2
#memory-report = true
lazy-apps = true
socket = /tmp/uwsgi.sock
chmod-socket = 666
pidfile = /tmp/uwsgi.pid
logto = /var/log/openerpserver/uwsgi.log
#eval = import newrelic.agent, wsgi; application = newrelic.agent.wsgi_application()(wsgi.application)