community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1867176 - /comdev/reporter.apache.org/trunk/scripts/gunicorn.sh
Date Thu, 19 Sep 2019 13:14:28 GMT
Author: sebb
Date: Thu Sep 19 13:14:28 2019
New Revision: 1867176

URL: http://svn.apache.org/viewvc?rev=1867176&view=rev
Log:
Script to handle gunicorn; += reload

Modified:
    comdev/reporter.apache.org/trunk/scripts/gunicorn.sh

Modified: comdev/reporter.apache.org/trunk/scripts/gunicorn.sh
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/gunicorn.sh?rev=1867176&r1=1867175&r2=1867176&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/gunicorn.sh (original)
+++ comdev/reporter.apache.org/trunk/scripts/gunicorn.sh Thu Sep 19 13:14:28 2019
@@ -44,11 +44,23 @@ stop(){
     fi
 }
 
+reload(){
+    if [ $(id -un) == 'www-data' ]
+    then
+        pkill -HUP -f gunicorn3
+    else
+        echo "You must run this as www-data"
+    fi
+}
+
 # allow multiple commands in sequence, e.g. stop status wait
 
 for cmd
 do
     case "$cmd" in
+        reload)
+            reload
+        ;;
         stop)
             stop
         ;;
@@ -72,7 +84,7 @@ do
             pgrep -o -f "gunicorn3.*wsgi:app"
         ;;
         *)
-            echo "Command '$cmd' not recognised: stop, restart, start, status, ppid"
+            echo "Command '$cmd' not recognised: reload, stop, restart, start, status, ppid"
         ;;
     esac
 done



Mime
View raw message