Skip to content

Create application upstart script #16

@nack43

Description

@nack43

Context

This site give me the idea of making upstart script.

There is a lot of article for making upstart script for Flask + Gunicorn projects.
Actually, I do not understand why I should use upstart script perfectly. Why is it not sytemd unit file, init script? I should understand what they are for.

Problem

I execute gunicorn --bind 127.0.0.1:5000 wsgi:app when I start the application every single time.
Also when I stop the process, I do ps -ef |grep '{print $2}' |xargs kill -9 every single time as well.

There is no logs. So it is hard to find the cause of bugs. If I can do just systemctl start/stop/status <service name>, it makes easier to deploy.

Solution

Make upstart script for this application. Then manage the access/error logs.

Reference

https://hostpresto.com/community/tutorials/deploy-flask-applications-with-gunicorn-and-nginx-on-ubuntu-14-04/

https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-14-04

https://pyliaorachel.github.io/blog/tech/system/2017/07/07/flask-app-with-gunicorn-on-nginx-server-upon-aws-ec2-linux.html

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions