no more gunicorn startup by default in debian/raspian 9

General Discussion

no more gunicorn startup by default in debian/raspian 9

Postby billfor » Wed Feb 20, 2019 5:09 pm

Hi, I updated my raspberry pi to the latest raspian based on debian 9 stretch, as part of the upgrade there are a number of warnings about deprecated stuff. Relevant to alarmdecoder it seems they removed the gunicorn systemd stubs, and those have to be done manually now. Looking at the alarmdecoder site I dont' see any instructions for this, so was wondering if there are some, othwerwise I'm going to have to write a systemd stub for it.

Is there a configuration that you have ?

In the meantime I am starting it up by hand:


/usr/local/bin/gunicorn --log-file /tmp/gunicorn.log -D --chdir /opt/alarmdecoder-webapp --worker-class=socketio.sgunicorn.GeventSocketIOWorker wsgi:application --timeout=120 --env=POLICY_SERVER=0


Here is the notice during the jessie->stretch upgrade:
gunicorn (19.6.0-3) unstable; urgency=medium

The /etc/gunicorn.d (and related usr/sbin/gunicorn{,3}-debian) scripts were
removed in 19.6.0-3 due to inflexibility, lack of documentation, not
adopted/supported upstream, did not work with virtualenvs, etc.

They were dropped prior to the stretch release to avoid having to support it
for another full release.

Users relying on this feature should invoke gunicorn manually. For an example
systemd .service file, please see the ``gunicorn-mysite.service`` file in the
gunicorn-examples package or a process manager such as runit, etc.

billfor
Junior Nut
Junior Nut
 
Posts: 29
Joined: Wed Mar 01, 2017 4:32 pm

Re: no more gunicorn startup by default in debian/raspian 9

Postby billfor » Sat Feb 23, 2019 12:52 pm

OK so to answer my own question again, I looked around and saw that there is some type of automation to install on debian9.

https://github.com/nutechsoftware/alarm ... /PiBakery/

Buried in that is a systemd unit, which I have attached here.

Just change the user and group name to something that makes sense for you, and install it.

Code: Select all
cp alarmdecoder.service /etc/systemd/system
systemctl enable alarmdecoder.service
systemctl start alarmdecoder.service
billfor
Junior Nut
Junior Nut
 
Posts: 29
Joined: Wed Mar 01, 2017 4:32 pm

Re: no more gunicorn startup by default in debian/raspian 9

Postby billfor » Sat Feb 23, 2019 12:56 pm

Not sure why I can't upload it as an attachment. btw it would be great to just put this in the contrib directory or someplace easy to get at:
[Unit]
Description=alarmdecoder
After=network.target

[Service]
PIDFile=/run/gunicorn/pid
User=root
Group=root
WorkingDirectory=/opt/alarmdecoder-webapp
ExecStart=/usr/bin/gunicorn --worker-class=socketio.sgunicorn.GeventSocketIOWorker --timeout=120 --env=POLICY_SERVER=0 --log-level=debug wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target
billfor
Junior Nut
Junior Nut
 
Posts: 29
Joined: Wed Mar 01, 2017 4:32 pm

Re: no more gunicorn startup by default in debian/raspian 9

Postby mathewss » Mon Feb 25, 2019 3:37 pm

Are you able to submit it on github? I will happily accept a pull request(PR) for stuff in the existing contrib folder

Best
Sean M
mathewss
Moderator
Moderator
 
Posts: 188
Joined: Fri Dec 06, 2013 11:14 am


Return to General

Who is online

Users browsing this forum: No registered users and 7 guests

cron