Parcourir la source

Script to restart gnusocial daemons if needed

Bob Mottram il y a 9 ans
Parent
révision
665fe8f761
1 fichiers modifiés avec 12 ajouts et 2 suppressions
  1. 12
    2
      src/freedombone

+ 12
- 2
src/freedombone Voir le fichier

8439
 	# update to the next commit
8439
 	# update to the next commit
8440
 	set_repo_commit /var/www/$MICROBLOG_DOMAIN_NAME/htdocs "GNU Social commit" "$MICROBLOG_COMMIT" $MICROBLOG_REPO
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
 	if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
8452
 	if grep -Fxq "install_gnu_social" $COMPLETION_FILE; then
8443
 		return
8453
 		return
8444
 	fi
8454
 	fi
8733
 	cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
8743
 	cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
8734
 	msgfmt -o Sharings.mo Sharings.po
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
 	if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then
8748
 	if ! grep -q "GNU Social sharings plugin commit" $COMPLETION_FILE; then
8739
 		echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE
8749
 		echo "GNU Social sharings plugin commit:$SHARINGS_COMMIT" >> $COMPLETION_FILE
8740
 	else
8750
 	else