The subshell was a mistake to begin with.  The -e was needed for the script
to make use of $?.  The block contaning the -e has a single exit point and
this will more than undo the -e.  Perhaps the hunks could have been broken
up, I see the first patch as being trivial(minimal for package upgrade) and
the second makes changes to the output of the script.
On Feb 6, 2014 9:09 PM, "Antoine Beaupré" <anar...@debian.org> wrote:

> On 2014-02-06 20:13:03, Mike Mestnik wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Attached find two patch files, one bug/lintian and the other
> > incorporates features.
>
> Hi!
>
> First, thanks for the patches! It's always appreciated.
>
> Can you clarify a little more why those patches are necessary?
>
> For example, here:
>
> > diff --git a/debian/init.d b/debian/init.d
> > index c026287..89bad8d 100644
> > --- a/debian/init.d
> > +++ b/debian/init.d
> > @@ -29,6 +29,7 @@ if [ "$ENABLED" != "1" ] ; then
> >  fi
> >
> >  set -e
> > +. /lib/lsb/init-functions
> >
> >  case "$1" in
> >    start)
> > @@ -104,12 +105,11 @@ case "$1" in
> >               exit 3
> >       else
> >               if [ -f "$RUNDIR/atheme.pid" ]; then
> > -                     ( set +e
> > +                     set +e
> >                       start-stop-daemon --status --quiet --pidfile
> $RUNDIR/atheme.pid
> >                       ext=$?
> >                       echo "."
> >                       exit $ext
> > -                     )
> >               fi
> >               echo "pid file missing."
> >               exit 3
>
> How do those two chunks relate? I understand sourcing init-functions may
> be a good idea, but why remove the subshell?
>
> It seems to me that we disable error-checking for the whole script
> there, and only in this case... a little messy. If we want to avoid the
> subshell, we should probably "|| true" somewhere on the critical section
> instead of removing the subshell.
>
> > diff --git a/debian/init.d b/debian/init.d
> > index 89bad8d..77e9452 100644
> > --- a/debian/init.d
> > +++ b/debian/init.d
> > @@ -99,23 +99,7 @@ case "$1" in
> >       echo "."
> >       ;;
> >    status)
> > -     echo -n "Status $DESC: $NAME "
> > -     if [ ! -d "$RUNDIR" ]; then
> > -             echo "run folder missing!"
> > -             exit 3
> > -     else
> > -             if [ -f "$RUNDIR/atheme.pid" ]; then
> > -                     set +e
> > -                     start-stop-daemon --status --quiet --pidfile
> $RUNDIR/atheme.pid
> > -                     ext=$?
> > -                     echo "."
> > -                     exit $ext
> > -             fi
> > -             echo "pid file missing."
> > -             exit 3
> > -     fi
> > -     echo unknown.
> > -     exit 4
> > +     status_of_proc -p $RUNDIR/atheme.pid $DAEMON $NAME
> >       ;;
> >    *)
> >       N=/etc/init.d/$NAME
>
> This one makes a little more sense, but maybe the init function sourcing
> belongs here?
>
> Thanks again,
>
> A.
>
> --
> Ou bien Dieu voudrait supprimer le mal, mais il ne le peut pas
> Ou bien Dieu pourrait supprimer le mal, mais il ne le veut pas.
>                         - Sebastien Faure
>

Reply via email to