[DRE-commits] [diaspora-installer] 06/07: use eye for restart

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Aug 28 14:32:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository diaspora-installer.

commit 6d24fbc021aa86d33a168d75754cfa353cf55892
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Fri Aug 28 17:56:35 2015 +0530

    use eye for restart
---
 debian/changelog            |  1 +
 debian/diaspora-common.init | 26 ++++++++++----------------
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1e2a97c..1b1fbd4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ diaspora-installer (0.5.2.0+debian4) UNRELEASED; urgency=medium
   * Move diaspora.yml and database.yml to /etc to better handle configuration
     changes during upgrades
   * Run bundle exec for eye
+  * Use eye for restart in init script
 
  -- Pirate Praveen <praveen at debian.org>  Fri, 28 Aug 2015 13:18:50 +0530
 
diff --git a/debian/diaspora-common.init b/debian/diaspora-common.init
index 535a77a..776520c 100644
--- a/debian/diaspora-common.init
+++ b/debian/diaspora-common.init
@@ -153,22 +153,16 @@ case "$1" in
     ;;
   restart|force-reload)
     [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
-    do_stop
-    case "$?" in
-      0|1)
-        sleep 5
-        do_start
-        case "$?" in
-            0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-            1) [ "$VERBOSE" != no ] && log_failure_msg "old process is still running" && log_end_msg 1 ;;
-            *) [ "$VERBOSE" != no ] && log_failure_msg "failed to start" && log_end_msg 1 ;;
-        esac
-        ;;
-      *)
-        [ "$VERBOSE" != no ] && log_failure_msg "failed to stop"
-        [ "$VERBOSE" != no ] && log_end_msg 1
-        ;;
-    esac
+
+    if ! check_eye
+    then
+        log_action_msg "Eye not found, Diaspora is DOWN"
+    else
+        for i in `check_eye`; do
+            log_action_msg "Found eye with PID $i"
+            sudo -u $USER -E -H bundle exec eye restart diaspora
+        done
+    fi
     ;;
   *)
     echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora-installer.git



More information about the Pkg-ruby-extras-commits mailing list