Changes between Version 20 and Version 21 of InstallationGuidelines/Linux/Server/CherokeePostgreSQL


Ignore:
Timestamp:
01/27/12 22:40:50 (13 years ago)
Author:
Praneeth Bodduluri
Comment:

uwsgi changed to daemon with its own init script

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelines/Linux/Server/CherokeePostgreSQL

    v20 v21  
    120120cd ..
    121121
    122 # Configure Cherokee
     122# Configure uwsgi
     123
    123124cat << EOF > "/home/web2py/uwsgi.xml"
    124125<uwsgi>
     126    <uid>web2py</uid>
     127    <gid>web2py</gid>
    125128    <pythonpath>/home/web2py/</pythonpath>
    126129    <app mountpoint="/">
     
    128131    </app>
    129132    <workers>4</workers>
     133    <pidfile>/tmp/uwsgi-prod.pid</pidfile>
     134    <daemonize>/var/log/uwsgi/prod.log</daemonize>
     135    <socket>127.0.0.1:59025</socket>
     136    <master/>
    130137</uwsgi>
    131138EOF
     139
     140touch /tmp/uwsgi-prod.pid
     141chown web2py: /tmp/uwsgi-prod.pid
     142
     143mkdir -p /var/log/uwsgi
     144chown web2py: /var/log/uwsgi
     145
     146# Init script for uwsgi
     147
     148cat << EOF > "/etc/init.d/uwsgi"
     149#! /bin/bash
     150# /etc/init.d/uwsgi
     151#
     152
     153daemon=/usr/local/bin/uwsgi
     154pid=/tmp/uwsgi-prod.pid
     155args="-x /home/web2py/uwsgi.xml"
     156
     157# Carry out specific functions when asked to by the system
     158case "$1" in
     159    start)
     160        echo "Starting uwsgi"
     161        start-stop-daemon -p $pid --start --exec $daemon -- $args
     162        ;;
     163    stop)
     164        echo "Stopping script uwsgi"
     165        start-stop-daemon --signal INT -p $pid --stop $daemon -- $args
     166        ;;
     167    reload)
     168        echo "Reloading conf"
     169        kill -HUP $(cat $pid)
     170        ;;
     171    *)
     172        echo "Usage: /etc/init.d/uwsgi {start|stop|reload}"
     173        exit 1
     174    ;;
     175esac
     176exit 0
     177EOF
     178
     179chmod a+x /etc/init.d/uwsgi
     180update-rc.d uwsgi defaults
     181
     182
     183# Configure Cherokee
    132184
    133185mv "$CHEROKEE_CONF" /tmp
     
    237289source!1!nick = uWSGI 1
    238290source!1!timeout = 300
    239 source!1!type = interpreter
     291source!1!type = host
    240292source!1!user = web2py
    241293EOF
     
    270322EOF
    271323
    272 chown -R www-data /usr/local/var/lib/cherokee
     324
    273325/etc/init.d/cherokee restart
    274326