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 886273 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-neutron
0001-improve-service-startup-with-sysv-initscript.patch (text/plain), 4.30 KB, created by
Alan Pevec
on 2014-04-14 21:30:02 UTC
(
hide
)
Description:
corresponding packaging patch for rhos4 openstack-neutron
Filename:
MIME Type:
Creator:
Alan Pevec
Created:
2014-04-14 21:30:02 UTC
Size:
4.30 KB
patch
obsolete
>From 2834e865fe33d4329ffdda7bdd46fe5ccedb7aa6 Mon Sep 17 00:00:00 2001 >From: Alan Pevec <apevec@redhat.com> >Date: Fri, 10 Jan 2014 03:39:20 +0100 >Subject: [PATCH] improve service startup with sysv initscript > >use systemd style readiness notification to signal when daemon is ready >and avoid premature return from "daemon" command. > >Fix for rhbz#1036515 in openstack-neutron >--- > daemon_notify.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ > neutron-server.init | 6 ++++- > openstack-neutron.spec | 9 ++++++++ > 3 files changed, 73 insertions(+), 1 deletion(-) > create mode 100755 daemon_notify.sh > >diff --git a/daemon_notify.sh b/daemon_notify.sh >new file mode 100755 >index 0000000..585cfec >--- /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 neutron.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/neutron-server.init b/neutron-server.init >index be258ff..062e6d6 100644 >--- a/neutron-server.init >+++ b/neutron-server.init >@@ -19,6 +19,9 @@ configs=( > ) > pidfile="/var/run/$prog/$prog.pid" > logfile="/var/log/$prog/server.log" >+startuplog="/var/log/$prog/$prog-server-startup.log" >+timeout=60 >+wrapper="/usr/share/$prog/daemon_notify.sh" > > [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog > >@@ -42,7 +45,8 @@ start() { > done > _check_running > echo -n $"Starting $prog: " >- daemon --user neutron --pidfile $pidfile "$exec ${configs[@]/#/--config-file } --log-file $logfile &>/dev/null & echo \$! > $pidfile" >+ execparam="$exec ${configs[@]/#/--config-file } --log-file $logfile" >+ daemon --user neutron --pidfile $pidfile "$wrapper \"$execparam\" $pidfile $startuplog $timeout" > retval=$? > echo > [ $retval -eq 0 ] && touch $lockfile >diff --git a/openstack-neutron.spec b/openstack-neutron.spec >index a35eea1..7983153 100644 >--- a/openstack-neutron.spec >+++ b/openstack-neutron.spec >@@ -20,6 +20,7 @@ Source5: neutron-node-setup > Source6: neutron-dhcp-setup > Source7: neutron-l3-setup > >+Source9: daemon_notify.sh > Source10: neutron-server.init > Source20: neutron-server.upstart > Source11: neutron-linuxbridge-agent.init >@@ -121,6 +122,10 @@ Requires(preun): chkconfig > Requires(preun): initscripts > Requires(pre): shadow-utils > >+# for daemon_notify >+Requires: /usr/bin/uuidgen >+Requires: /bin/sleep >+ > # dnsmasq is not a hard requirement, but is currently the only option > # when neutron-dhcp-agent is deployed. > Requires: dnsmasq >@@ -587,6 +592,9 @@ install -p -m 644 %{SOURCE40} %{buildroot}%{_datadir}/neutron/ > install -p -m 644 %{SOURCE41} %{buildroot}%{_datadir}/neutron/ > install -p -m 644 %{SOURCE42} %{buildroot}%{_datadir}/neutron/ > >+# Install service readiness wrapper >+install -p -D -m 755 %{SOURCE9} %{buildroot}%{_datadir}/neutron/daemon_notify.sh >+ > # Install dist conf > install -p -D -m 640 %{SOURCE90} %{buildroot}%{_datadir}/neutron/neutron-dist.conf > >@@ -903,6 +911,7 @@ fi > %{_datadir}/neutron/neutron-metadata-agent.upstart > %{_datadir}/neutron/neutron-l3-agent.upstart > %{_datadir}/neutron/neutron-lbaas-agent.upstart >+%{_datadir}/neutron/daemon_notify.sh > %dir %{_sysconfdir}/neutron > %{_sysconfdir}/neutron/release > %attr(-, root, neutron) %{_datadir}/neutron/neutron-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
Actions:
View
|
Diff
Attachments on
bug 1036515
:
886114
| 886273 |
886948
|
886960
|
886961
|
886962
|
886976
|
886978
|
887135