On Fri, 30 Sep 2016 20:06:26 +0100
Chris Lamb <la...@debian.org> wrote:

> [Switching 839...@bugs.debian.org → 839...@bugs.debian.org]
> 
> Hi Neil,
> 
> Thanks for your patience and understanding; didn't mean to break your
> installation and I can understand that the initscript (etc.) sticking
> around would have been rather confusing. That (ie. #839183) is now
> fixed.
> 
> > OK - should the process just start automatically via apache or
> > similar?  
> 
> No; it really needs to run as a regular standalone process rather than
> being managed by a web browser. Apache might (?) support such a thing
> but its not only a bit old-fashioned, nginx — the far more common web
> server for gunicorn IME! — does not support such things.

One step at a time .... we have some very old code in lava-server until
at least 2017, it may not take nicely to switching away from apache.
Gunicorn is as big a change as I want to make this close to an upstream
release which will go into the next Debian stable release.
 
> > What is the new upstream method for starting gunicorn?  
> 
> They basically don't have one and simply point you towards some kind
> of process monitor such as runit, gaffer, etc. This is mostly because
> most of "their" users are using some combination of:
> 
>  - virtualenv
>  - python2 or python3
>  - weird install paths
>  - user/groups
> 
> > My test system uses systemd  
> 
> Lets get that bit working first. Can you try a .service file like:
> 
> == lavaserver.service ================================================
> 
> [Unit]
> Description=lavaserver
> After=network.target
> 
> [Install]
> WantedBy=multi-user.target
> 
> [Service]
> User=lavaserver
> Group=lavaserver
> Restart=always
> 
> ExecStart=/usr/bin/gunicorn --workers=4 --log-level=debug
> lava_server.wsgi ExecReload=/bin/kill -s HUP $MAINPID
> ExecStop=/bin/kill -s TERM $MAINPID
> 
> PrivateTmp=true
> 
> ====================================================================


After a couple of false starts (because lava-server is already complex
and has multiple daemons, so the name lava-server.service needed to be
amended), this systemd file does allow me to run gunicorn 19.6.0-6 and
for the current gunicorn support to provide a working localhost django
server.

$ sudo service lava-server-gunicorn status
● lava-server-gunicorn.service - lavaserver
   Loaded: loaded (/lib/systemd/system/lava-server-gunicorn.service; enabled; 
vendor preset: enabled)
   Active: active (running) since Sat 2016-10-01 02:59:13 BST; 23s ago
 Main PID: 32216 (gunicorn: maste)
   CGroup: /system.slice/lava-server-gunicorn.service
           ├─32216 gunicorn: master [lava_server.wsgi]
           ├─32243 gunicorn: worker [lava_server.wsgi]
           ├─32250 gunicorn: worker [lava_server.wsgi]
           ├─32252 gunicorn: worker [lava_server.wsgi]
           └─32254 gunicorn: worker [lava_server.wsgi]

Oct 01 02:59:13 sylvester gunicorn[32216]:   logger_class: 
gunicorn.glogging.Logger
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32216] 
[INFO] Starting gunicorn 19.6.0
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32216] 
[DEBUG] Arbiter booted
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32216] 
[INFO] Listening at: http://127.0.0.1:8000 (32216)
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32216] 
[INFO] Using worker: sync
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32243] 
[INFO] Booting worker with pid: 32243
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32250] 
[INFO] Booting worker with pid: 32250
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32252] 
[INFO] Booting worker with pid: 32252
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32254] 
[INFO] Booting worker with pid: 32254
Oct 01 02:59:13 sylvester gunicorn[32216]: [2016-10-01 02:59:13 +0000] [32216] 
[DEBUG] 4 workers

I'm offline this weekend, I'll start testing with upgrades from jessie
when I'm back but this looks like it should be enough to allow the
developer builds of the package to install gunicorn for the first time
and switch away from uwsgi. Next will be the sysVinit support. (The
final service will likely be lava-server-wsgi - long story but it's
going to take a while to remove the deprecated lava-server daemon.)

I'll push my local packaging changes to a gunicorn branch once I'm back
online.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

Attachment: pgpv3i5NKOThF.pgp
Description: OpenPGP digital signature

Reply via email to