Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
I have configured my uwsgi.ini file and its working fine with nohup. How can auto start uwsgi on boot?

Here is my uesgi.conf code

description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn

env UWSGI=/usr/local/bin/uwsgi
env LOGTO=/var/log/uwsgi.log

exec $UWSGI --master --emperor /home/ubuntu/socialtalks/config --die-on-term --uid socialtalks --gid www-data --logto $LOGTO

Here is the ini file configuration.

uwsgi.ini

    [uwsgi]
# variables
#projectname = thesocialtalks
#base = /home/ubuntu/thesocialtalks

# configuration
#master = true
env = /home/ubuntu/socialtalks
#pythonpath = %(base)
#chdir = %(base)
env = DJANGO_SETTINGS_MODULE=%(projectname).settings.production
#module = thesocialtalks.wsgi:application
#socket = /tmp/%(projectname).sock

# mysite_uwsgi.ini file
[uwsgi]
projectname = socialtalks
pcre = true
base = /home/ubuntu/socialtalks
# Django-related settings
# the base directory (full path)
#chdir           = /home/ubuntu/socialtalks
chdir = %(base)
# Django's wsgi file
#module          = socialtalks.wsgi
module           = %(projectname).wsgi
# the virtualenv (full path)
#home            = /home/admin5/test/thesocialtalks_final/thesocialtalks
plugin = python37
# process-related settings
# master
master          = true
enable-threads = true

# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe
#socket          = /home/ubuntu/socialtalks/mysite.sock
socket = /tmp/%(projectname).sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
uid = www-data
gid = www-data

# clear environment on exit
vacuum          = true

I am running the script using the command

nohup uwsgi --ini config/uwsgi.ini &

How to automate my uwsgi to auto start after system boot?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You definitely can install supervisor that will allow you to run wathever programa and keep checking the state of it to be sure the program is running.

[program:test]
autostart = true
stopsignal=QUIT
user=root
command=uwsgi --master --workers  5 --disable-logging --socket 127.0.0.1:8888
--module web --callable app
priority=1
redirect_stderr=true
stdout_logfile = /data/log

To setup supervisor you can take a look of this documentation: https://www.programmersought.com/article/97941378800/ and to start supervisor at boot you can type the following command:

# Make sure Supervisor comes up after a reboot.
sudo systemctl enable supervisor

# Bring Supervisor up right now.
sudo systemctl start supervisor

To get more information you can go to the next thread: https://unix.stackexchange.com/questions/281774/ubuntu-server-16-04-cannot-get-supervisor-to-start-automatically.

I'm not an expert with UWSGI but I have seem lot of repositories working with Django and UWSGI using this combination.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!