I have quite a few comments and I think this script is not yet production ready!
Non functional: * the file header is for an init script, this is not an init script => add a standard header with copyright and some comments what this script is doing * white space is mixed and style is not according to the script design rules at devel.opensaf.org Functional: * bashisms * there is no initial sync with the start of the dtm process, if dtm starts slowly this script will reboot the node! * cat of the PID file should be placed outside the loop, PID value cannot change inside the loop and use of cat forks an extra child process every second! * do not use the old "expr" construct. Use POSIX style instead: x=$(($x + 1)) * stop does nothing and is not used (killed hard from opensafd script), start * the init style args can be removed since they are not needed, this scripts does one thing and that's it Thanks, Hans > -----Original Message----- > From: A V Mahesh [mailto:[email protected]] > Sent: den 21 november 2013 06:25 > To: Hans Feldt > Subject: Re: [devel] [PATCH 1 of 1] mds: correct osaf-transport-monitor > script to avoid looping when sh is not bash [#232] > > Hi Hans, > > Have you got a chance to look in this patch. > > -AVM > > On 11/15/2013 9:49 AM, [email protected] wrote: > > osaf/services/infrastructure/dtms/scripts/osaf-transport-monitor.in | 8 > > ++++---- > > 1 files changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git > > a/osaf/services/infrastructure/dtms/scripts/osaf-transport-monitor.in > > b/osaf/services/infrastructure/dtms/scripts/osaf- > transport-monitor.in > > --- a/osaf/services/infrastructure/dtms/scripts/osaf-transport-monitor.in > > +++ b/osaf/services/infrastructure/dtms/scripts/osaf-transport-monitor.in > > @@ -43,8 +43,8 @@ start() { > > fi > > > > if [ ! "$MDS_TRANSPORT" = "TIPC" ] ; then > > - COUNT=0 > > - while ((COUNT < 15)) > > + count=0 > > + while [ $count -le 15 ] > > do > > pidval=`cat $pkgpiddir/$prog.pid` > > if ! test -d /proc/$pidval ; then > > @@ -52,9 +52,9 @@ start() { > > $pkglibdir/opensaf_reboot 0 > > exit 0; > > fi > > - #logger "osafdtmd PID : $pidval monitor COUNT > > = $COUNT" > > + #logger "osafdtmd PID : $pidval monitor count > > = $count" > > sleep 1 > > - ((COUNT=COUNT+1)) > > + count=`expr $count + 1` > > done > > else > > sleep 15 > > > > ------------------------------------------------------------------------------ > > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > > Free app hosting. Or install the open source package on any LAMP server. > > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > > _______________________________________________ > > Opensaf-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
