2017-06-11 23:34:13 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Crans Portail Captif
|
|
|
|
Requires=nginx.service
|
|
|
|
Requires=portail_captif.socket
|
|
|
|
After=nginx.service
|
|
|
|
After=network-online.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=forking
|
|
|
|
User=root
|
|
|
|
Group=root
|
|
|
|
PIDFile=/run/portail_captif.pid
|
|
|
|
WorkingDirectory=/var/www/portail_captif/
|
2017-06-12 01:58:05 +00:00
|
|
|
ExecStartPre=/usr/bin/python3 /var/www/portail_captif/portail_captif/start_portail.py
|
2017-06-11 23:34:13 +00:00
|
|
|
ExecStart=/usr/bin/gunicorn3 portail_captif.wsgi:application --pid=/run/portail_captif.pid --name www-data --user www-data --group www-data --daemon --log-file /var/log/gunicorn/portail_captif.log --log-level=info --bind=unix:///tmp/gunicorn-portail_captif.sock --workers=1
|
|
|
|
ExecReload=/bin/kill -s HUP $MAINPID
|
|
|
|
ExecStop=/bin/kill -s TERM $MAINPID
|
2017-06-12 01:58:05 +00:00
|
|
|
ExecStopPost=/usr/bin/python3 /var/www/portail_captif/portail_captif/stop_portail.py
|
2017-06-11 23:34:13 +00:00
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=65
|
|
|
|
StartLimitInterval=60
|
|
|
|
StartLimitBurst=2
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
Also=portail_captif.socket
|