LSB function status_of_proc missing PID argument in the initscript

Bug #1452880 reported by Caio Begotti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Released
High
Daniel Manrique

Bug Description

It seems /lib/lsb/init-functions was always meant to be used with -p ${PID} otherwise it can wrongly guess the name of the process binary, which changed over the time for Capomastro I suppose otherwise this wouldn't have worked before as it was.

Without -p ${PID} "service capomastro status" will not check the right process and will probably return the wrong status of the service.

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :

So in debian/capomastro.init, change:

do_status () {
  status_of_proc "${DAEMON}" "Service ${NAME}"

  [ "${?}" = 2 ] && return 2
  return "${?}"
}

should change to (notice I'm also doing some return value storing):

do_status () {
  status_of_proc -p ${PIDFILE} "${DAEMON}" "Service ${NAME}"
  retval=${?}

  [ "${retval}" = 2 ] && return 2
  return "${retval}"
}

According to the /lib/lsb/init-functions code and other examples in /etc/init.d, it can be called with the pidfile (not necessarily the PID itself), which makes this a quite simple change.

tags: added: low-hanging-fruit
Changed in capomastro:
milestone: none → 2015-06
importance: Undecided → High
status: New → Triaged
Daniel Manrique (roadmr)
Changed in capomastro:
status: Triaged → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Daniel Manrique (roadmr)
Changed in capomastro:
status: In Progress → Fix Committed
Daniel Manrique (roadmr)
Changed in capomastro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.