When running multiple instances of memcached, the pid filename is as a ${PORT} component that is undefined when its name is created. Reproducible: Always Steps to Reproduce: 1. ln -s /etc/init.d/memcached /etc/init.d/i1 2. cp /etc/conf.d/memcached /etc/conf.d/memcached.i1 3. /etc/init.d/i1 start 4. ps axo command | grep memcached Actual Results: /usr/bin/memcached -d -p 11211 -U 11211 -m 5120 -c 1024 -u memcached -P /var/run/memcached/memcached-.i1.pid Expected Results: /usr/bin/memcached -d -p 11211 -U 11211 -m 5120 -c 1024 -u memcached -P /var/run/memcached/memcached-11211.i1.pid Proposed patch: --- /etc/init.d/memcached 2012-11-23 03:31:01.000000000 -0500 +++ /etc/init.d/memcached-new 2012-11-23 03:30:22.000000000 -0500 @@ -8,16 +8,16 @@ [ "${CONF}" == "memcached" ] && CONF='' if [ -n "${CONF}" ]; then - PIDFILE="${PIDBASE}-${PORT}.${CONF}.pid" CONFSRC="${CONFBASE}.${CONF}" if [ -f "${CONFSRC}" ]; then source "${CONFSRC}" + PIDFILE="${PIDBASE}-${PORT}.${CONF}.pid" else eerror "The configuration file $CONFSRC was not found!" fi else - PIDFILE="${PIDBASE}-${PORT}.pid" CONFSRC="${CONFBASE}" + PIDFILE="${PIDBASE}-${PORT}.pid" fi depend() {
Created attachment 330306 [details] proposed.patch Attached proposed patch.
I'm fine with this in general, but how does it handle if port is undefined? robbat2, what do you think?