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).
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.