mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-13 08:42:21 -05:00
Updated aws start/stop scripts to handle multiple start/stop scripts
Primarily to handle the two celery processes
This commit is contained in:
@@ -1,4 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Starting application"
|
if [ -e "/etc/init/notifications-api.conf" ]
|
||||||
sudo service notifications-api start
|
then
|
||||||
|
echo "Starting api"
|
||||||
|
sudo service notifications-api start
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/etc/init/notifications-api-celery-worker.conf" ]
|
||||||
|
then
|
||||||
|
echo "Starting celery worker"
|
||||||
|
sudo service notifications-api-celery-worker start
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/etc/init/notifications-api-celery-beat.conf" ]
|
||||||
|
then
|
||||||
|
echo "Starting celery beat"
|
||||||
|
sudo service notifications-api-celery-beat start
|
||||||
|
fi
|
||||||
|
|||||||
@@ -7,9 +7,29 @@ function error_exit
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Stopping application"
|
if [ -e "/etc/init/notifications-api.conf" ]; then
|
||||||
if sudo service notifications-api stop; then
|
echo "stopping notifications-api"
|
||||||
exit 0
|
if sudo service notifications-api stop; then
|
||||||
else
|
echo "notifications-api stopped"
|
||||||
error_exit "Could not stop application"
|
else
|
||||||
fi
|
error_exit "Could not stop notifications-api"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/etc/init/notifications-api-celery-beat.conf" ]; then
|
||||||
|
echo "stopping notifications-api-celery-beat"
|
||||||
|
if sudo service notifications-api-celery-beat stop; then
|
||||||
|
echo "notifications-api stopped"
|
||||||
|
else
|
||||||
|
error_exit "Could not stop notifications-celery-beat"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/etc/init/notifications-api-celery-worker.conf" ]; then
|
||||||
|
echo "stopping notifications-api-celery-worker"
|
||||||
|
if sudo service notifications-api-celery-worker stop; then
|
||||||
|
echo "notifications-api stopped"
|
||||||
|
else
|
||||||
|
error_exit "Could not stop notifications-celery-worker"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user