upstart service Centos 6.7

Issues related to applications and software problems
Post Reply
kanishk
Posts: 1
Joined: 2018/05/12 05:43:32

upstart service Centos 6.7

Post by kanishk » 2018/05/12 07:34:20

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

tunk
Posts: 377
Joined: 2017/02/22 15:08:17

Re: upstart service Centos 6.7

Post by tunk » 2018/05/12 11:33:45

Try to remove "env" from the two lines.
And you really should update to CentOS 6.9.

Whoever
Posts: 1024
Joined: 2013/09/06 03:12:10

Re: upstart service Centos 6.7

Post by Whoever » 2018/05/12 16:18:50

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".

User avatar
TrevorH
Forum Moderator
Posts: 23467
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: upstart service Centos 6.7

Post by TrevorH » 2018/05/12 16:22:03

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.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply