Seems like Daphne and runworker both terminate after session expires

On Saturday, March 23, 2019 at 7:51:26 PM UTC-7, Adam Zedan wrote:
>
> I am trying to create a bash script that would run Daphne and runworker in 
> the background.
> This is what I came up with so far
>
>
> echo "Killing Redis....."
> killall redis-server
>
>
> #echo "Starting redis Server....."
> redis-server --daemonize yes
>
>
> echo "Stopping NGINX......"
> sudo /etc/init.d/nginx stop
>
>
> echo "Starting NGINX......"
> sudo /etc/init.d/nginx start
>
>
> echo "Killing Daphne......"
> sudo kill -9 $(ps aux | grep 'daphne' | awk '{print $2}')
>
>
> echo "Starting Daphne....."
> /home/ec2-user/MyDomainVenv/bin/daphne -b 0.0.0.0 -p 8001 
> main.asgi:channel_layer 
> 2>> ./daphne.log &
>
>
> echo "Starting Django worker thread...."
> #nohup python ./manage.py runworker 2>>./daphneWorker.log >&2 &
> python ./manage.py runworker
>
>
> However it seems like run worker simply terminates when my ssh session 
> expires. I tried nohup statement as well.
> How did you fix this problem ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c45cc88e-cbbf-4474-87d4-37910719e366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to