Skip to content
Snippets Groups Projects
Commit 9eedf1ad authored by Piotr Gawron's avatar Piotr Gawron
Browse files

gunicorn configured

parent 3af95406
No related branches found
No related tags found
1 merge request!264Resolve "prepare installable debian package"
Pipeline #33744 passed
......@@ -15,7 +15,7 @@ cp smash/manage.py debian/smash/manage.py
cp -r debian-template debian/debian-template
cp CHANGELOG debian/debian-template/changelog
rm debian/smash/smash/local_settings.py
cp local_settings_debian.py debian/smasch.py
cp -r debian-files debian/debian-files
CURRENT_VERSION=`cat CHANGELOG |grep smasch |head -1 | cut -f2 -d'(' | cut -f1 -d')'`
......
[Unit]
Description=gunicorn daemon for smasch
Requires=gunicorn.socket
After=network.target
[Service]
PIDFile=/run/gunicorn/pid
User=smasch
Group=smasch
WorkingDirectory=/usr/lib/smasch
ExecStart=/usr/lib/smasch/env/bin/gunicorn --pid /run/gunicorn/pid smash.wsgi --error-logfile /var/log/smasch/gunicorn.log --log-level DEBUG --capture-output --limit-request-line 8192
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/gunicorn/socket
ListenStream=0.0.0.0:8888
ListenStream=[::]:9999
[Install]
WantedBy=sockets.target
File moved
......@@ -3,4 +3,7 @@ smash/web /usr/lib/smasch
smash/smash /usr/lib/smasch
../requirements.txt /usr/lib/smasch
../requirements-dev.txt /usr/lib/smasch
smasch.py /etc/smasch/
debian-files/smasch.py /etc/smasch/
debian-files/gunicorn.service /lib/systemd/system/
debian-files/gunicorn.socket /lib/systemd/system/
......@@ -2,7 +2,7 @@
set -e
LOG_FILE=/var/log/smasch-install.log
LOG_FILE=/var/log/smasch/install.log
if [ "$1" = "configure" ] && [ -z "$2" ]; then
id -u somename &>/dev/null || useradd smasch
......@@ -16,7 +16,12 @@ if [ "$1" = "configure" ] && [ -z "$2" ]; then
chown smasch:smasch /etc/smasch/smasch.py
chmod 0600 /etc/smasch/smasch.py
mkdir /run/gunicorn/
chown -R smasch:smasch /run/gunicorn/
mkdir /var/log/smasch
chown -R smasch:smasch /var/log/smasch
fi
echo "Instal python dependencies"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment