start
This commit is contained in:
27
Restart.sh
Executable file
27
Restart.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
###!/usr/bin/env bash
|
||||
|
||||
echo "Мягко закрываем службу"
|
||||
killall -s 15 gunicorn -r
|
||||
x=7
|
||||
#P = if pgrep 'gunicorn';
|
||||
#echo $P
|
||||
while [ $x -gt 0 ] && pgrep 'gunicorn' ;
|
||||
do
|
||||
sleep 1
|
||||
echo "Ожидание закрытия сек: $x"
|
||||
x=$(( $x - 1 ))
|
||||
done
|
||||
|
||||
|
||||
if pgrep 'gunicorn';
|
||||
then
|
||||
echo "Принудительно убиваем службу"
|
||||
killall -s 9 gunicorn -r
|
||||
sleep 3
|
||||
else
|
||||
echo "Служба успешно закрыта"
|
||||
|
||||
fi
|
||||
|
||||
sh Gunicorn.sh
|
||||
Reference in New Issue
Block a user