[Bug 1177398] [NEW] init-script status method doesn't handle instances correctly

Bjunity 1177398 at bugs.launchpad.net
Tue May 7 14:21:07 UTC 2013


Public bug reported:


Line in /etc/init.d/memcached:


status_of_proc -p $PIDFILE $DAEMON $NAME  && exit 0 || exit $?


If you have more than 1 Instance the script exit after the first instance found, so the other instances aren't checked.

The quick & dirty fix:


er_or=0


CONFIG_NUM=${#CONFIGS[@]}
.


.
.
.

status)


      status_of_proc -p $PIDFILE $DAEMON $NAME

       returnvalue=`echo $?`

      if [ "$returnvalue" -ne "0" ]
        then
         er_or=`expr $er_or \+ 1`
      fi


       ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
        exit 1
        ;;
esac
done;


if [ "$er_or" -ne "0" ]
then
        exit 2
else
        exit 0
fi

** Affects: memcached (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to memcached in Ubuntu.
https://bugs.launchpad.net/bugs/1177398

Title:
  init-script status method doesn't handle instances correctly

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/1177398/+subscriptions



More information about the Ubuntu-server-bugs mailing list