[DRE-commits] [diaspora-installer] 01/01: adapt init script for eye
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Aug 27 18:56:48 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 96dbe1f09e4b2f771e70234a151271ec30e33a46
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Fri Aug 28 00:26:11 2015 +0530
adapt init script for eye
---
debian/changelog | 3 +-
debian/diaspora-common.init | 85 ++++++++++-----------------------------------
2 files changed, 21 insertions(+), 67 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8bbd57c..fae4476 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
diaspora-installer (0.5.2.0+debian2) UNRELEASED; urgency=medium
- * Use invoke-rc.d to start diaspora
+ * Use invoke-rc.d to start diaspora in postinst
+ * Use adapt init script for eye (monitoring tool)
-- Pirate Praveen <praveen at debian.org> Thu, 27 Aug 2015 20:50:33 +0530
diff --git a/debian/diaspora-common.init b/debian/diaspora-common.init
index 32b7555..e3e664b 100644
--- a/debian/diaspora-common.init
+++ b/debian/diaspora-common.init
@@ -37,19 +37,15 @@ STARTUP_TIMEOUT=100
. /lib/lsb/init-functions
check_unicorn() {
- pgrep -f "unicorn_rails master"
+ pgrep -f "unicorn master"
}
check_sidekiq() {
- pgrep -f "sidekiq 3"
+ pgrep -f "sidekiq [0-9\.]* diaspora"
}
-check_foreman() {
- pgrep -f "foreman-runner"
-}
-
-check_foreman_start() {
- pgrep -f "foreman start"
+check_eye() {
+ pgrep -f "eye monitoring [a-zA-Z0-9\.]* \[diaspora\]"
}
check_script_server() {
@@ -73,7 +69,7 @@ do_start()
return 1
fi
- if check_foreman || check_foreman_start || check_script_server; then
+ if check_script_server; then
log_warning_msg "Diaspora is starting"
return 1
fi
@@ -105,14 +101,10 @@ do_start()
do_stop()
{
- for i in `check_unicorn`; do
- [ "$VERBOSE" != no ] && log_action_msg "Killing unicorn master with PID $i"
- kill -TERM $i
- [ "$VERBOSE" != no ] && log_action_end_msg $?
- done
+ sudo -u $USER -E -H eye stop diaspora
- for i in `check_sidekiq`; do
- [ "$VERBOSE" != no ] && log_action_msg "Killing sidekiq with PID $i"
+ for i in `check_eye`; do
+ [ "$VERBOSE" != no ] && log_action_msg "Killing eye with PID $i"
kill -TERM $i
[ "$VERBOSE" != no ] && log_action_end_msg $?
done
@@ -140,61 +132,22 @@ case "$1" in
status)
log_daemon_msg 'Checking for running Diaspora processes'
- if ! check_unicorn
+ if ! check_eye
then
- log_action_msg "unicorn not found"
- unicorn_running=false
+ log_action_msg " Eye not found"
+ if ! check_script_server
+ then
+ log_action_msg "Diaspora is DOWN"
+ else
+ log_action_msg "Diaspora is STARTING"
+ fi
else
- for i in `check_unicorn`; do
- log_action_msg "Found unicorn master with PID $i"
- unicorn_running=true
+ for i in `check_eye`; do
+ log_action_msg " Found eye with PID $i"
+ sudo -u $USER -E -H eye info diaspora
done
fi
- if ! check_foreman
- then
- log_action_msg "foreman not found"
- foreman_running=false
- else
- for i in `check_foreman`; do
- log_action_msg "Found foreman with pid $i"
- foreman_running=true
- done
- fi
-
- if ! check_sidekiq
- then
- log_action_msg "sidekiq is not found"
- sidekiq_running=false
- else
- for i in `check_sidekiq`; do
- log_action_msg "Found sidekiq with PID $i"
- sidekiq_running=true
- done
- fi
-
- if $foreman_running && ! $unicorn_running; then
- log_action_msg "Diaspora is starting, check after some time..."
- log_end_msg 0
- return 0
- fi
- if $unicorn_running && $sidekiq_running; then
- log_action_msg "Diaspora health is OK"
- log_end_msg 0
- else
- if $unicorn_running; then
- log_failure_msg "Unicorn is RUNNING, but sidekiq is DOWN!"
- log_end_msg 1
- return 1
- fi
- if $sidekiq_running; then
- log_failure_msg "Sidekiq is RUNNING, but unicorn is DOWN!"
- log_end_msg 1
- return 1
- fi
- log_daemon_msg "All Diaspora processes are DOWN"
- log_end_msg 0
- fi
;;
restart|force-reload)
[ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
--
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