Ubuntu 16.04.3 Desktop version.
gunicorn (version 19.7.1)
virtualenv 15.1.0
I'd like Gunicorn to start on boot. Gunicorn is integrated with Django.
/etc/init/photoarchive.conf
description "Gunicorn server for photoarchive"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid server
setgid server
chdir /home/server/photoarchive/photoarchive
exec /home/server/photoarchive/venv/photoarchive/bin/gunicorn photoarchive.wsgi
What is done for self-check:
1.
cd /home/server/photoarchive/photoarchive ls
I can see manage.py.
2.
cd /home/server/photoarchive/venv/photoarchive/bin/ I can see gunicorn file.
cd /var/log/upstart
It is empty.
3.
$ ps aux | grep gunicorn
server 2715 0.0 0.0 21292 948 pts/6 S+ 10:12 0:00 grep --color=auto gunicorn
Well, this is grep has grepped itself.
Activate virtualenv.
cd /home/server/photoarchive/photoarchive gunicorn photoarchive.wsgi
Now gunicorn is running. So, manually it starts.
Could you help me organize running gunicorn on start?
Hello,
Is this upstart? I thought that Ubuntu doesn't use upstart any more, but that it uses systemd instead (since version 15.04 IIRC). Maybe it contains upstart for backwards compatibility, but I think it's not a good idea to invest in learning upstart right now.
If you want to do it with systemd, which is what I recommend, you could try my recorded webinar, which also contains a cheat sheet with the systemd configuration. Otherwise you could use supervisor, which was the most recommended solution until recently (because upstart and/or init scripts were cumbersome), and which people still use more than systemd, first because systemd is newer, and second because systemd's documentation is suboptimal so it's harder to get started.
Regards,
Antonis
Antonis Christofides http://djangodeployment.com
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e021369b-9846-4daf-906d-246d52b2dbbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Antonis, thank you.Yes, this is upstart. I'll try it with systemd as you suggested.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c8308c91-bce1-4bb0-9cdb-16ce326d4e13%40googlegroups.com.