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 887135 Details for
Bug 1036515
Fix some OpenStack init scripts to return non-zero if service cannot start
[?]
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]
corresponding packaging patch for rhos4 openstack-glance
0001-improve-service-startup-with-sysv-initscript.patch (text/plain), 5.48 KB, created by
Alan Pevec
on 2014-04-17 10:53:12 UTC
(
hide
)
Description:
corresponding packaging patch for rhos4 openstack-glance
Filename:
MIME Type:
Creator:
Alan Pevec
Created:
2014-04-17 10:53:12 UTC
Size:
5.48 KB
patch
obsolete
>From c0482fe2b670bfe0b4559732428e388bbc9b41b2 Mon Sep 17 00:00:00 2001 >From: Alan Pevec <apevec@redhat.com> >Date: Fri, 10 Jan 2014 03:39:20 +0100 >Subject: [PATCH 1/3] improve service startup with sysv initscript > >use systemd style readiness notification to signal when daemon is ready >and avoid premature return from "daemon" command. > >Do not log to stderr by default. > >We are setting logfile explicitly so parallel output on stderr is not expected. >This was creating duplicate log output to startup.log in daemon_notify.sh >it was masked in previous initscripts with redirection to /dev/null. > >Fix for rhbz#1036515 in openstack-glance >--- > daemon_notify.sh | 59 ++++++++++++++++++++++++++++++++++++++++++ > openstack-glance-api.init | 5 +++- > openstack-glance-registry.init | 5 +++- > openstack-glance.spec | 11 ++++++++ > 4 files changed, 78 insertions(+), 2 deletions(-) > create mode 100644 daemon_notify.sh > >diff --git a/daemon_notify.sh b/daemon_notify.sh >new file mode 100644 >index 0000000..b105876 >--- /dev/null >+++ b/daemon_notify.sh >@@ -0,0 +1,59 @@ >+#!/bin/bash >+ >+# >+# start process in the background and wait for its readiness notification >+# via systemd style NOTIFY_SOCKET >+# >+daemon_notify() { >+ exec=$1 >+ pidfile=$2 >+ startuplog=$3 >+ timeout=$4 >+ >+ # Requires: >+ # uuidgen (util-linux) >+ # sleep (coreutils) >+ export NOTIFY_SOCKET='@/org/rdoproject/systemd/notify/'$(uuidgen) >+ python -m glance.openstack.common.systemd $timeout & >+ pidnotify=$! >+ $exec &>$startuplog & >+ pid=$! >+ while [ -d /proc/$pid -a -d /proc/$pidnotify ] >+ do >+ sleep 1 >+ done >+ # pick up return codes from either process >+ if [ ! -d /proc/$pid ] >+ then >+ wait $pid >+ retval=$? >+ else >+ retval=-1 >+ fi >+ if [ ! -d /proc/$pidnotify ] >+ then >+ wait $pidnotify >+ retnotify=$? >+ else >+ retnotify=-1 >+ fi >+ if [ $retnotify -eq 0 ] >+ then >+ # readiness notification received, all OK >+ echo $pid > $pidfile >+ return 0 >+ else >+ # readiness not received >+ if [ $retval -eq -1 ] >+ then >+ # process exists in unknown state >+ return 1 >+ else >+ # startup failed >+ return $retval >+ fi >+ fi >+} >+ >+daemon_notify "$@" >+exit $? >diff --git a/openstack-glance-api.init b/openstack-glance-api.init >index 00c8a51..d36c243 100644 >--- a/openstack-glance-api.init >+++ b/openstack-glance-api.init >@@ -21,6 +21,9 @@ prog=openstack-glance-$suffix > exec="/usr/bin/glance-$suffix" > config="/etc/glance/glance-$suffix.conf" > pidfile="/var/run/glance/glance-$suffix.pid" >+startuplog="/var/log/glance/$prog-startup.log" >+timeout=60 >+wrapper="/usr/share/glance/daemon_notify.sh" > > [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog > >@@ -30,7 +33,7 @@ start() { > [ -x $exec ] || exit 5 > [ -f $config ] || exit 6 > echo -n $"Starting $prog: " >- daemon --user glance --pidfile $pidfile "$exec &>/dev/null & echo \$! > $pidfile" >+ daemon --user glance --pidfile $pidfile "$wrapper $exec $pidfile $startuplog $timeout" > retval=$? > echo > [ $retval -eq 0 ] && touch $lockfile >diff --git a/openstack-glance-registry.init b/openstack-glance-registry.init >index 8a8850b..225b7a9 100644 >--- a/openstack-glance-registry.init >+++ b/openstack-glance-registry.init >@@ -21,6 +21,9 @@ prog=openstack-glance-$suffix > exec="/usr/bin/glance-$suffix" > config="/etc/glance/glance-$suffix.conf" > pidfile="/var/run/glance/glance-$suffix.pid" >+startuplog="/var/log/glance/$prog-startup.log" >+timeout=60 >+wrapper="/usr/share/glance/daemon_notify.sh" > > [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog > >@@ -30,7 +33,7 @@ start() { > [ -x $exec ] || exit 5 > [ -f $config ] || exit 6 > echo -n $"Starting $prog: " >- daemon --user glance --pidfile $pidfile "$exec &>/dev/null & echo \$! > $pidfile" >+ daemon --user glance --pidfile $pidfile "$wrapper $exec $pidfile $startuplog $timeout" > retval=$? > echo > [ $retval -eq 0 ] && touch $lockfile >diff --git a/openstack-glance.spec b/openstack-glance.spec >index c55c100..71dbd36 100644 >--- a/openstack-glance.spec >+++ b/openstack-glance.spec >@@ -21,6 +21,7 @@ Source5: glance-api-dist.conf > Source6: glance-registry-dist.conf > Source7: glance-cache-dist.conf > Source8: glance-scrubber-dist.conf >+Source9: daemon_notify.sh > > # > # patches_base=2013.2.3+1 >@@ -48,6 +49,11 @@ Requires(post): chkconfig > Requires(preun): initscripts > Requires(preun): chkconfig > Requires(pre): shadow-utils >+ >+# for daemon_notify >+Requires: /usr/bin/uuidgen >+Requires: /bin/sleep >+ > Requires: python-glance = %{version}-%{release} > Requires: python-glanceclient >= 1:0 > Requires: openstack-utils >@@ -212,6 +218,9 @@ install -p -m 644 %{SOURCE100} %{buildroot}%{_datadir}/glance/ > install -p -m 644 %{SOURCE200} %{buildroot}%{_datadir}/glance/ > install -p -m 644 %{SOURCE300} %{buildroot}%{_datadir}/glance/ > >+# Install service readiness wrapper >+install -p -D -m 755 %{SOURCE9} %{buildroot}%{_datadir}/glance/daemon_notify.sh >+ > # Logrotate config > install -p -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/openstack-glance > >@@ -313,6 +322,8 @@ fi > %{_datadir}/glance/openstack-glance-registry.upstart > %{_datadir}/glance/openstack-glance-scrubber.upstart > >+%{_datadir}/glance/daemon_notify.sh >+ > %{_datadir}/glance/glance-api-dist.conf > %{_datadir}/glance/glance-registry-dist.conf > %{_datadir}/glance/glance-cache-dist.conf >-- >1.9.0 >
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
Flags:
pbrady
: review+
Actions:
View
|
Diff
Attachments on
bug 1036515
:
886114
|
886273
|
886948
|
886960
|
886961
|
886962
|
886976
|
886978
| 887135