Page 1 of 1

upstart service Centos 6.7

Posted: 2018/05/12 07:34:20
by kanishk
description "uWSGI_pricing_service"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI_ALIVE=/var/www/html/pricing-service/venv/bin/uwsgi
env LOGTO_ALIVE=/var/www/html/pricing-service/log/emperor.log
exec $UWSGI_ALIVE --master --emperor /var/www/html/pricing-service/
uwsgi.ini --die-on-term --uid jose --gid jose --logto $LOGTO_ALIVE

I am having a problem in above line of code if I start the service with these lines it gives an error unknown job but if I remove these following lines

env UWSGI_ALIVE=/var/www/html/pricing-service/venv/bin/uwsgi
env LOGTO_ALIVE=/var/www/html/pricing-service/log/emperor.log
it actually starts the file but then my web app did not run, I am new server developer please help me

Re: upstart service Centos 6.7

Posted: 2018/05/12 11:33:45
by tunk
Try to remove "env" from the two lines.
And you really should update to CentOS 6.9.

Re: upstart service Centos 6.7

Posted: 2018/05/12 16:18:50
by Whoever
kanishk wrote:description "uWSGI_pricing_service"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI_ALIVE=/var/www/html/pricing-service/venv/bin/uwsgi
env LOGTO_ALIVE=/var/www/html/pricing-service/log/emperor.log
exec $UWSGI_ALIVE --master --emperor /var/www/html/pricing-service/
uwsgi.ini --die-on-term --uid jose --gid jose --logto $LOGTO_ALIVE

I am having a problem in above line of code if I start the service with these lines it gives an error unknown job but if I remove these following lines

env UWSGI_ALIVE=/var/www/html/pricing-service/venv/bin/uwsgi
env LOGTO_ALIVE=/var/www/html/pricing-service/log/emperor.log
it actually starts the file but then my web app did not run, I am new server developer please help me


I think that "env" should be "export".

Re: upstart service Centos 6.7

Posted: 2018/05/12 16:22:03
by TrevorH
And skipping ahead to the next problem that you haven't found yet, /var/www/html is the wrong place to log to. Selinux will complain bitterly and stop you. Log files should go under /var/log not /var/www.