First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 209792
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Robin Johnson <robbat2@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Adrian Goins <agoins@arces.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
vblade0_0.init.patch patch to /etc/init.d/vblade.vblade0_0 patch Adrian Goins 2008-02-12 09:22 0000 620 bytes Details | Diff
vblade0_0.init.patch (corrected) patch for /etc/init.d/vblade0_0 patch Adrian Goins 2008-02-13 06:43 0000 611 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 209792 depends on: Show dependency tree
Show dependency graph
Bug 209792 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-02-12 09:15 0000
the init script was changed as a result of 137016 to do some egrep parsing to
find the vblade pid and stop it.  this syntax looks like the following:

ps -Ao pid,args | egrep "^[[:space:]]*[[:digit:]]+ /usr/sbin/vbladed ${shelf}
${slot} ${netif} ${src}" | awk '{print $1}' | xargs kill

this syntax fails because the actual process looks like the following:

5602 /bin/sh /usr/sbin/vbladed 0 3 eth0 /dev/ar/gauntlet-root

the egrep is missing the following:

* /bin/sh
* /usr/sbin/vbladed (instead of /usr/sbin/vblade)

additionally, it gets the full string it's looking for from /etc/conf.d/vblade,
which means that if /etc/conf.d/vblade is modified before the particular vblade
in question is stopped, the process it's looking for is wrong.  for example, if
i change /etc/conf.d/vblade to have 0,3 running on eth1 instead of eth0 and
then try to stop vblade 0,3 it will look for the process with 'eth1' in the
string instead of 'eth0'.  the process will not be stopped.



Reproducible: Always

Steps to Reproduce:
1. run /etc/init.d/vblade.vblade0_0 to stop a running vblade
2. run /etc/init.d/vblade.vblade0_0 to stop a running vblade after changing
/etc/conf.d/vblade


Actual Results:  
the egrep fails and xargs isn't passed anything to kill, causing it to exit
with errors.

Expected Results:  
it should have stopped the vblade.

the correct syntax for the egrep (tested valid on my system) is:

ps -Ao pid,args | egrep "^[[:space:]]*[[:digit:]]+ /bin/sh /usr/sbin/vbladed
${shelf} ${slot}" | awk '{ print $1 }' | xargs kill

this looks for the bare minimum unique information (shelf/slot) to stop the
process, without looking at information that may have changed in the
configuration file (interface, physical partition).

------- Comment #1 From Adrian Goins 2008-02-12 09:22:09 0000 -------
Created an attachment (id=143290) [edit]
patch to /etc/init.d/vblade.vblade0_0

this is a unified diff of my modified init script

------- Comment #2 From Adrian Goins 2008-02-13 06:42:37 0000 -------
after further research yesterday i realized that my initial report wasn't 100%
accurate.  the /bin/sh...vbladed line is actually controlled by the line that
the original egrep text looks for, and my patch and modification to vbladed0_0
doesn't work properly.

the problem of the script getting its information from /etc/conf.d/vblade is
still correct - if this file has changed then an existing vblade cannot be
stopped.  i've changed the init script and have an updated patch that does work
correctly.

------- Comment #3 From Adrian Goins 2008-02-13 06:43:23 0000 -------
Created an attachment (id=143395) [edit]
(corrected) patch for /etc/init.d/vblade0_0

updated patch that identifies the correct process for signalling

------- Comment #4 From Robin Johnson 2008-07-05 09:53:50 0000 -------
incvs.

please open a stabilization bug in 1 week if it works fine.

First Last Prev Next    No search results available      Search page      Enter new bug