Script to restart gnusocial daemons if needed

This commit is contained in:
Bob Mottram 2016-05-14 19:45:55 +01:00
parent c5b74fafff
commit 665fe8f761
1 changed files with 12 additions and 2 deletions

View File

@ -8439,6 +8439,16 @@ function install_gnu_social {
# update to the next commit # update to the next commit
set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
# add a script to check that the daemon is running
echo '#!/bin/bash' > /etc/cron.daily/gnusocial-daemons
echo 'daemon_lines=$(ps aux | grep "scripts/queuedaemon.php" | grep "/var/www")' >> /etc/cron.daily/gnusocial-daemons
echo 'if [[ $daemon_lines != *"/var/www/"* ]]; then' >> /etc/cron.daily/gnusocial-daemons
echo " echo \"Restarting GNU Social daemons\" | mail -s \"GNU Social daemons not found\" $MY_EMAIL_ADDRESS" >> /etc/cron.daily/gnusocial-daemons
echo " cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs" >> /etc/cron.daily/gnusocial-daemons
echo ' scripts/startdaemons.sh' >> /etc/cron.daily/gnusocial-daemons
echo 'fi' >> /etc/cron.daily/gnusocial-daemons
chmod +x /etc/cron.daily/gnusocial-daemons
if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
return return
fi fi
@ -8733,7 +8743,7 @@ function install_gnu_social_plugin_sharings {
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
msgfmt -o Sharings.mo Sharings.po msgfmt -o Sharings.mo Sharings.po
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then
echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE