Stop daemons from root

This commit is contained in:
Bob Mottram 2017-06-03 17:49:23 +01:00
parent e747a001cc
commit f6b0037c29
2 changed files with 6 additions and 6 deletions

View File

@ -404,7 +404,7 @@ function restore_local_gnusocial {
gnusocial_dir=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
# stop the daemons
cd $gnusocial_dir
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
function_check gnusocial_create_database
gnusocial_create_database
@ -452,7 +452,7 @@ function restore_remote_gnusocial {
# stop the daemons
cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
function_check gnusocial_create_database
gnusocial_create_database
@ -487,7 +487,7 @@ function remove_gnusocial {
fi
if [ -f /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/stopdaemons.sh ]; then
cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
fi
kill_pid=$(ps aux | grep /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/queuedaemon.php | awk -F ' ' '{print $2}' | head -n 1)
kill -9 $kill_pid

View File

@ -411,7 +411,7 @@ function restore_local_postactiv {
postactiv_dir=/var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
# stop the daemons
cd $postactiv_dir
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
function_check postactiv_create_database
postactiv_create_database
@ -455,7 +455,7 @@ function restore_remote_postactiv {
# stop the daemons
cd /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
function_check postactiv_create_database
postactiv_create_database
@ -489,7 +489,7 @@ function remove_postactiv {
fi
if [ -f /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/stopdaemons.sh ]; then
cd /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts
su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
scripts/stopdaemons.sh
fi
kill_pid=$(ps aux | grep /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/queuedaemon.php | awk -F ' ' '{print $2}' | head -n 1)
kill -9 $kill_pid