<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>209792</bug_id>
          
          <creation_ts>2008-02-12 09:15 0000</creation_ts>
          <short_desc>sys-block/vblade: /etc/init.d/vblade.vblade0 script doesn&apos;t stop vblades (egrep parsing error)</short_desc>
          <delta_ts>2008-07-05 09:53:50 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>agoins@arces.net</reporter>
          <assigned_to>robbat2@gentoo.org</assigned_to>
          <cc>base-system@gentoo.org</cc>
    
    <cc>tobias.pal@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>agoins@arces.net</who>
            <bug_when>2008-02-12 09:15:11 0000</bug_when>
            <thetext>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 &quot;^[[:space:]]*[[:digit:]]+ /usr/sbin/vbladed ${shelf} ${slot} ${netif} ${src}&quot; | awk &apos;{print $1}&apos; | 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&apos;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&apos;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 &apos;eth1&apos; in the string instead of &apos;eth0&apos;.  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&apos;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 &quot;^[[:space:]]*[[:digit:]]+ /bin/sh /usr/sbin/vbladed ${shelf} ${slot}&quot; | awk &apos;{ print $1 }&apos; | 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).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agoins@arces.net</who>
            <bug_when>2008-02-12 09:22:09 0000</bug_when>
            <thetext>Created an attachment (id=143290)
patch to /etc/init.d/vblade.vblade0_0

this is a unified diff of my modified init script</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agoins@arces.net</who>
            <bug_when>2008-02-13 06:42:37 0000</bug_when>
            <thetext>after further research yesterday i realized that my initial report wasn&apos;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&apos;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&apos;ve changed the init script and have an updated patch that does work correctly.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agoins@arces.net</who>
            <bug_when>2008-02-13 06:43:23 0000</bug_when>
            <thetext>Created an attachment (id=143395)
(corrected) patch for /etc/init.d/vblade0_0

updated patch that identifies the correct process for signalling</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2008-07-05 09:53:50 0000</bug_when>
            <thetext>incvs.

please open a stabilization bug in 1 week if it works fine.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>143290</attachid>
            <date>2008-02-12 09:22 0000</date>
            <desc>patch to /etc/init.d/vblade.vblade0_0</desc>
            <filename>vblade0_0.init.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHZibGFkZS52YmxhZGUwXzAub3JpZyAgICAgICAyMDA4LTAyLTEyIDA0OjE4OjE2LjAwMDAw
MDAwMCAtMDUwMAorKysgdmJsYWRlLnZibGFkZTBfMCAgICAyMDA4LTAyLTEyIDA0OjE3OjQ4LjAw
MDAwMDAwMCAtMDUwMApAQCAtMTA0LDcgKzEwNCw3IEBACiAgICAgICAgZWJlZ2luICJTdG9wcGlu
ZyAke3Nydm5hbWV9IgogICAgICAgICNzdGFydC1zdG9wLWRhZW1vbiAtLXN0b3AgLS1xdWlldCAt
LXBpZGZpbGUgJHtwaWRmaWxlfQogICAgICAgIGdldGNvbmZpZwotICBwcyAtQW8gcGlkLGFyZ3Mg
fCBlZ3JlcCAiXltbOnNwYWNlOl1dKltbOmRpZ2l0Ol1dKyAvdXNyL3NiaW4vdmJsYWRlZCAke3No
ZWxmfSAke3Nsb3R9ICR7bmV0aWZ9ICR7c3JjfSIgfCBhd2sgJ3twcmludCAkMX0nIHwgeGFyZ3Mg
a2lsbAorICBwcyAtQW8gcGlkLGFyZ3MgfCBlZ3JlcCAiXltbOnNwYWNlOl1dKltbOmRpZ2l0Ol1d
KyAvYmluL3NoIC91c3Ivc2Jpbi92YmxhZGVkICR7c2hlbGZ9ICR7c2xvdH0iIHwgYXdrICd7IHBy
aW50ICQxIH0nIHwgeGFyZ3Mga2lsbAogICAgICAgIGVlbmQgJD8KIAogICAgICAgICNzdGFydC1z
dG9wLWRhZW1vbiAtLXN0b3AgLS1xdWlldCAtLWV4ZWMgL3Vzci9zYmluL3ZibGFkZQo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>143395</attachid>
            <date>2008-02-13 06:43 0000</date>
            <desc>(corrected) patch for /etc/init.d/vblade0_0</desc>
            <filename>vblade0_0.init.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHZibGFkZS52YmxhZGUwXzAub3JpZyAgICAgICAyMDA4LTAyLTEyIDA0OjE4OjE2LjAwMDAw
MDAwMCAtMDUwMAorKysgdmJsYWRlLnZibGFkZTBfMCAgICAyMDA4LTAyLTEzIDAxOjM4OjU4LjAw
MDAwMDAwMCAtMDUwMApAQCAtMTA0LDcgKzEwNCw3IEBACiAgICAgICAgZWJlZ2luICJTdG9wcGlu
ZyAke3Nydm5hbWV9IgogICAgICAgICNzdGFydC1zdG9wLWRhZW1vbiAtLXN0b3AgLS1xdWlldCAt
LXBpZGZpbGUgJHtwaWRmaWxlfQogICAgICAgIGdldGNvbmZpZwotICBwcyAtQW8gcGlkLGFyZ3Mg
fCBlZ3JlcCAiXltbOnNwYWNlOl1dKltbOmRpZ2l0Ol1dKyAvdXNyL3NiaW4vdmJsYWRlZCAke3No
ZWxmfSAke3Nsb3R9ICR7bmV0aWZ9ICR7c3JjfSIgfCBhd2sgJ3twcmludCAkMX0nIHwgeGFyZ3Mg
a2lsbAorICBwcyAtQW8gcGlkLGFyZ3MgfCBlZ3JlcCAiXltbOnNwYWNlOl1dKltbOmRpZ2l0Ol1d
KyAvdXNyL3NiaW4vdmJsYWRlICR7c2hlbGZ9ICR7c2xvdH0iIHwgYXdrICd7IHByaW50ICQxIH0n
IHwgeGFyZ3Mga2lsbAogICAgICAgIGVlbmQgJD8KIAogICAgICAgICNzdGFydC1zdG9wLWRhZW1v
biAtLXN0b3AgLS1xdWlldCAtLWV4ZWMgL3Vzci9zYmluL3ZibGFkZQo=
</data>        

          </attachment>
    </bug>

</bugzilla>