Doron Shoham wrote: > Checking if the tgtd daemon is running should be > done with pidof
It also exits if tgtd daemon is not running, instead of loading it. > > Signed-off-by: Doron Shoham <[EMAIL PROTECTED]> > --- > scripts/tgt-setup-lun | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/scripts/tgt-setup-lun b/scripts/tgt-setup-lun > index 53bb934..cefbec9 100755 > --- a/scripts/tgt-setup-lun > +++ b/scripts/tgt-setup-lun > @@ -153,11 +153,14 @@ initiators=$* > > verify_params > > -# Check if tgtd is running (we should have 2 daemons) > -tgtd_count=$(ps aux|grep -c tgtd) > -if [ $tgtd_count -ne 3 ]; then > - echo "Starting tgtd" > - tgtd > + > +# Check if tgtd is running > +pidof tgtd &>/dev/null > +ret=$? > +if [ $ret -ne 0 ]; then > + echo "tgtd is not running" > + echo "Exiting..." > + exit 1 > fi > > tgt_name="iqn.2001-04.com.$(hostname -s)-$tgt_name" _______________________________________________ Stgt-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/stgt-devel
