I believe you meant to do:

uwsgicmd="${uwsgicmd} --daemonize --logto=$HOME/logs/$(basename $DIR).log";

--daemonize doesn't receive a param, maybe a typo?

However I'd suggest moving the logging flags to your .ini file and only
leave --daemonize in the command call.


Cheers

On Mon, Apr 20, 2020 at 03:18:00PM +1200, Glenn Reed wrote:
> Hoping someone might be able to advise me
> 
> For some reason when I run uwsgi with this script I get no errors:
> 
> #!/bin/bash
> # Note --http should be used if pointing a browser directly
> # to this socket.  Otherwise if upstream from nginx use --socket
> 
> # Taken from 
> https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself#DIR="$(
>  cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
> while getopts ":dm:v:" o; do
>     case "${o}" in
>         d)
>             daemonize=true
>             ;;
>         m)
>             module=$OPTARG
>             ;;
>         v)
>             venv=$OPTARG
>             ;;
>         *)
>             ;;
>     esac
> done
> 
> DIR=$(pwd)
> echo "damonize=$daemonize"
> echo $DIR
> [ -d $HOME/logs ] || mkdir $HOME/logs
> [ -d $HOME/pids ] || mkdir $HOME/pids
> [ -d $HOME/sockets ] || mkdir $HOME/sockets
> 
> if [ -z "$module" ]; then
>    module=$(basename $DIR);
> fi
> 
> if [ -z "$venv" ]; then
>    venv="$HOME/venvs/$(basename $DIR)";
> fi
> source $venv/bin/activate
> read -d '' uwsgicmd << EOF
> 
> uwsgi --chdir=$DIR \
>     --module=$module.wsgi:application \
>     --master --pidfile=$HOME/pids/$(basename $DIR).pid \
>     --socket=/tmp/$(basename $DIR).sock \
>     --processes=1 \
>     --static-map /static=$DIR/static \
>     --chmod-socket=666 \
>     --harakiri=20 \
>     --max-requests=5000 \
>     --vacuum
> EOF
> if [ -n "${daemonize}" ]; then
>    uwsgicmd="${uwsgicmd} --daemonize=$HOME/logs/$(basename $DIR).log";  # 
> background the process
> fi
> 
> echo $uwsgicmd
> eval $uwsgicmd
> 
> ============================================
> 
> However when I try to run in emporer mode I get http 500 errors.
> 
> The main issue is not that I get errors but that I lose my error log when 
> running in emporer mode.
> 
> this is my into file for the vassal
> 
> [uwsgi]
> chdir = /home/webquest/html/whanganuijobs.co.nz
> uid = webquest
> gid = webquest
> socket = /tmp/%n.sock
> chmod-socket = 666
> plugins = python3
> processes = 1
> master = 1
> module = funeral_notices.wsgi:application
> env = DJANGO_SETTINGS_MODULE=funeral_notices.settings.production
> # Use home directive to specify virutalenv path
> log-master = true
> virtualenv = /home/webquest/venvs/whanganuijobs/
> 
> =========================
> 
> Even though I have log-master set to true I see no error log from the emporer 
> process.
> 
> Any ideas?

> _______________________________________________
> uWSGI mailing list
> uWSGI@lists.unbit.it
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi


-- 
The truth is what is; what should be is a dirty lie.
                -- Lenny Bruce

Attachment: signature.asc
Description: PGP signature

_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to