Pārlūkot izejas kodu

Script to restart gnusocial daemons if needed

Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
665fe8f761
1 mainītis faili ar 12 papildinājumiem un 2 dzēšanām
  1. 12
    2
      src/freedombone

+ 12
- 2
src/freedombone Parādīt failu

@@ -8439,6 +8439,16 @@ function install_gnu_social {
8439 8439
 	# update to the next commit
8440 8440
 	set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
8441 8441
 
8442
+	# add a script to check that the daemon is running
8443
+	echo '#!/bin/bash' > /etc/cron.daily/gnusocial-daemons
8444
+	echo 'daemon_lines=$(ps aux | grep "scripts/queuedaemon.php" | grep "/var/www")' >> /etc/cron.daily/gnusocial-daemons
8445
+	echo 'if [[ $daemon_lines != *"/var/www/"* ]]; then' >> /etc/cron.daily/gnusocial-daemons
8446
+	echo "    echo \"Restarting GNU Social daemons\" | mail -s \"GNU Social daemons not found\" $MY_EMAIL_ADDRESS" >> /etc/cron.daily/gnusocial-daemons
8447
+	echo "    cd /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs" >> /etc/cron.daily/gnusocial-daemons
8448
+	echo '    scripts/startdaemons.sh' >> /etc/cron.daily/gnusocial-daemons
8449
+	echo 'fi' >> /etc/cron.daily/gnusocial-daemons
8450
+	chmod +x /etc/cron.daily/gnusocial-daemons
8451
+
8442 8452
 	if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
8443 8453
 		return
8444 8454
 	fi
@@ -8733,8 +8743,8 @@ function install_gnu_social_plugin_sharings {
8733 8743
 	cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
8734 8744
 	msgfmt -o Sharings.mo Sharings.po
8735 8745
 
8736
-    chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
8737
-	
8746
+	chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
8747
+
8738 8748
 	if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then
8739 8749
 		echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE
8740 8750
 	else