Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 873213 Details for
Bug 1066408
mongodb init script returns OK even if service is not fully operational
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix.
0001-Make-mongod-init-script-intelligent.patch (text/plain), 2.18 KB, created by
Lon Hohberger
on 2014-03-11 17:05:21 UTC
(
hide
)
Description:
Fix.
Filename:
MIME Type:
Creator:
Lon Hohberger
Created:
2014-03-11 17:05:21 UTC
Size:
2.18 KB
patch
obsolete
>From 1e4b18a81a26731c2f7a07c3283c84ebf1eec7b0 Mon Sep 17 00:00:00 2001 >From: Lon Hohberger <lhh@redhat.com> >Date: Tue, 11 Mar 2014 12:59:14 -0400 >Subject: [PATCH] Make mongod init script intelligent > >Signed-off-by: Lon Hohberger <lhh@redhat.com> >--- > mongod.sysconf | 3 ++- > mongodb.init | 40 +++++++++++++++++++++++++++++++++++++++- > 2 files changed, 41 insertions(+), 2 deletions(-) > >diff --git a/mongod.sysconf b/mongod.sysconf >index 5d1d128..b5e5fa5 100644 >--- a/mongod.sysconf >+++ b/mongod.sysconf >@@ -1 +1,2 @@ >-MONGODB_OPTIONS="--quiet -f /etc/mongodb.conf" >+MONGODB_CONFIG="/etc/mongodb.conf" >+MONGODB_OPTIONS="--quiet -f $MONGODB_CONFIG" >diff --git a/mongodb.init b/mongodb.init >index fd033af..b779a67 100644 >--- a/mongodb.init >+++ b/mongodb.init >@@ -15,9 +15,11 @@ logfile="/var/log/mongodb/mongodb.log" > > [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog > >+lockfile="/var/lock/subsys/mongod" >+timeout=${MONGODB_START_TIMEOUT-30} > pidfile=${PIDFILE-/var/run/mongodb/mongodb.pid} >+configfile=${MONGODB_CONFIG-/etc/mongodb.conf} > options="$MONGODB_OPTIONS" >-lockfile="/var/lock/subsys/mongod" > > start() { > [ -x $exec ] || exit 5 >@@ -26,6 +28,18 @@ start() { > retval=$? > echo > [ $retval -eq 0 ] && touch $lockfile >+ >+ echo -n $"Waiting for $prog to become available: " >+ while ! rh_status_q; do >+ if [ $timeout -le 0 ]; then >+ echo_failure; echo >+ return 1 >+ fi >+ sleep 3 >+ ((timeout-=3)) >+ done >+ echo_success; echo >+ > return $retval > } > >@@ -52,8 +66,32 @@ force_reload() { > } > > rh_status() { >+ local p a > # run checks to determine if the service is running or use generic status > status -p ${pidfile} $prog >+ >+ # Grab address >+ a=$(grep ^bind_ip $configfile) >+ a=${a/*=/} >+ a=${a/#*/} >+ [ -z "$a" ] && a=127.0.0.1 >+ >+ # Grab port >+ p=$(grep ^port $configfile) >+ p=${p/*=/} >+ p=${p/#*/} >+ [ -z "$p" ] && p=27017 >+ >+ netstat -ln | grep -q "$a:$p" >+ [ $? -eq 0 ] || return 1 >+ >+ echo "listening on $a:$p" >+ >+ # Check db >+ mongostat -n 1 -h $a --port $p &> /dev/null >+ [ $? -ne 0 ] && return 1 >+ >+ echo "connection test successful" > } > > rh_status_q() { >-- >1.8.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1066408
:
873213
|
873215
|
888844
|
888909