Commit ccdd53e5 authored by Luís de Sousa's avatar Luís de Sousa
Browse files

Correcting launching processes in startup script.

parent 2dc13455
#!/bin/bash
# Create socket for Gunicorn
touch /var/www/wsm.rest/wsm.rest.sock
chown www-data:www-data /var/www/wsm.rest/wsm.rest.sock
# Launch Gunicorn
exec /usr/local/bin/gunicorn wsgi:app \
--workers 3 \
--bind unix:wsm.rest.sock \
-m 007
cd /var/www/wsm.rest
mkdir logs
echo "Launching Gunicorn..."
nohup /usr/local/bin/gunicorn wsgi:app --workers 3 --bind unix:wsm.rest.sock -m 007 </dev/null >logs/gunicorn.log 2>&1 &
# Remove default site from nginx
echo "Setting up nginx config."
rm /etc/nginx/sites-enabled/default
cp /var/www/wsm.rest/configs/wsm.rest.nginx /etc/nginx/sites-enabled/wsm.rest
echo "Launching nginx..."
nohup nginx </dev/null >logs/nginx.log 2>&1 &
# Launch neginx
exec nginx
# Wait a little for Gunicorn to set up
sleep 2
echo "Fixing access to socket."
chown www-data:www-data /var/www/wsm.rest/wsm.rest.sock
echo "All done. Good to go!"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment