Success!   --but it's not clear why!?!

I ran uwsgi with the following commmand line (note that I switched to unix 
sock in my location directive in nginx to match...):

uwsgi -s /tmp/web2py.sock --module wsgihandler --pythonpath /var/web2py 
--daemonize /var/log/uwsgi.log

This means that there is something funky in either my init script or in my 
xml:

Bruce: thanks for the init suggestions.  Mine was similar but I did not set 
OWNER (I would use www-data as I don't have a uwsgi user) and I did not set 
.e.

Roberto: I'll look at the parsing order link you sent.

Well, now I know it does work and can work with a "known good setting." 
 After I try to debug the "manly, professional" approach I can always 
revert to the cmd line or to using ini file approach.

Trial and error is not fun.  I have something that works but I still don't 
know what was "broke."

Thanks everyone.

I'll do a write up that is more "theory and practice" rather than cookbook. 
 There are too many variations to rely on anyone else's cookbook unless 
your own config is nearly identical to one that you try to mimic.

On Friday, May 18, 2012 11:03:52 AM UTC-7, Bruce Wade wrote:
>
> That is the only two lines I have nothing set on the command line. uwsgi 
> should by default look into that directory.
>
> Oh yes there is one other thing you need to change in /etc/init.d/uwsgi 
> (if you have this) the path to uwsgi is /usr/local/bin/uwsgi
> You also set in that file OWNER NAME DESC
>
> /etc/init.d/uwsgi:
> PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/bin
> DAEMON=/usr/local/bin/uwsgi
>
> OWNER=uwsgi
>
> NAME=uwsgi
> DESC=uwsgi
> echo "Trying test"
> test -x $DAEMON || exit 0
> echo "test passed"
> # Include uwsgi defaults if available
> if [ -f /etc/default/uwsgi ] ; then
>         . /etc/default/uwsgi
> fi
>
> set -e
> # I added --limit-post 4096 to prevent post attacks
> DAEMON_OPTS="-s 127.0.0.1:9001 -M 4 -t 30 -A 4 -p 4 -d /var/log/uwsgi.log 
> --pythonpath $PYTHONPATH --module $MODULE --limit-post 4096"
>
> case "$1" in
>   start)
>         echo -n "Starting $DESC: "
>         start-stop-daemon --start --chuid $OWNER:$OWNER --user $OWNER \
>                 --exec $DAEMON -- $DAEMON_OPTS
>         echo "$NAME."
>         ;;
>   stop)
>         echo -n "Stopping $DESC: "
>         start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 
> --stop \
>                 --exec $DAEMON
>         echo "$NAME."
>         ;;
>   reload)
>         killall -1 $DAEMON
>         ;;
>   force-reload)
>         killall -15 $DAEMON
>        ;;
>   restart)
>         echo -n "Restarting $DESC: "
>         start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 
> --stop \
>                 --exec $DAEMON
>         sleep 1
>         start-stop-daemon --user $OWNER --start --quiet --chuid 
> $OWNER:$OWNER \
>                --exec $DAEMON -- $DAEMON_OPTS
>         echo "$NAME."
>         ;;
>   status)
>         killall -10 $DAEMON
>         ;;
>       *)
>             N=/etc/init.d/$NAME
>             echo "Usage: $N 
> {start|stop|restart|reload|force-reload|status}" >&2
>             exit 1
>             ;;
>     esac
>     exit 0
>
> On Fri, May 18, 2012 at 10:58 AM, Roberto De Ioris <robe...@unbit.it>wrote:
>
>>
>> > Bruce:  do you only need two lines of uwsgi config?  Where do you put 
>> the
>> > rest of the directives?   command line?
>> >
>> > Does anyone know how to have one uwsgi config file load another (as we 
>> do
>> > in apache)?  I was trying to see an example or find it in uwsgi docs to 
>> no
>> > avail.
>> >
>> >
>>
>> http://projects.unbit.it/uwsgi/wiki/ParsingOrder
>>
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>>
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>  
On Friday, May 18, 2012 11:03:52 AM UTC-7, Bruce Wade wrote:
>
> That is the only two lines I have nothing set on the command line. uwsgi 
> should by default look into that directory.
>
> Oh yes there is one other thing you need to change in /etc/init.d/uwsgi 
> (if you have this) the path to uwsgi is /usr/local/bin/uwsgi
> You also set in that file OWNER NAME DESC
>
> /etc/init.d/uwsgi:
> PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/bin
> DAEMON=/usr/local/bin/uwsgi
>
> OWNER=uwsgi
>
> NAME=uwsgi
> DESC=uwsgi
> echo "Trying test"
> test -x $DAEMON || exit 0
> echo "test passed"
> # Include uwsgi defaults if available
> if [ -f /etc/default/uwsgi ] ; then
>         . /etc/default/uwsgi
> fi
>
> set -e
> # I added --limit-post 4096 to prevent post attacks
> DAEMON_OPTS="-s 127.0.0.1:9001 -M 4 -t 30 -A 4 -p 4 -d /var/log/uwsgi.log 
> --pythonpath $PYTHONPATH --module $MODULE --limit-post 4096"
>
> case "$1" in
>   start)
>         echo -n "Starting $DESC: "
>         start-stop-daemon --start --chuid $OWNER:$OWNER --user $OWNER \
>                 --exec $DAEMON -- $DAEMON_OPTS
>         echo "$NAME."
>         ;;
>   stop)
>         echo -n "Stopping $DESC: "
>         start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 
> --stop \
>                 --exec $DAEMON
>         echo "$NAME."
>         ;;
>   reload)
>         killall -1 $DAEMON
>         ;;
>   force-reload)
>         killall -15 $DAEMON
>        ;;
>   restart)
>         echo -n "Restarting $DESC: "
>         start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 
> --stop \
>                 --exec $DAEMON
>         sleep 1
>         start-stop-daemon --user $OWNER --start --quiet --chuid 
> $OWNER:$OWNER \
>                --exec $DAEMON -- $DAEMON_OPTS
>         echo "$NAME."
>         ;;
>   status)
>         killall -10 $DAEMON
>         ;;
>       *)
>             N=/etc/init.d/$NAME
>             echo "Usage: $N 
> {start|stop|restart|reload|force-reload|status}" >&2
>             exit 1
>             ;;
>     esac
>     exit 0
>
> On Fri, May 18, 2012 at 10:58 AM, Roberto De Ioris <robe...@unbit.it>wrote:
>
>>
>> > Bruce:  do you only need two lines of uwsgi config?  Where do you put 
>> the
>> > rest of the directives?   command line?
>> >
>> > Does anyone know how to have one uwsgi config file load another (as we 
>> do
>> > in apache)?  I was trying to see an example or find it in uwsgi docs to 
>> no
>> > avail.
>> >
>> >
>>
>> http://projects.unbit.it/uwsgi/wiki/ParsingOrder
>>
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>>
>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>  

Reply via email to