LSB function status_of_proc missing PID argument in the initscript
Bug #1452880 reported by
Caio Begotti
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Capomastro |
Fix Released
|
High
|
Daniel Manrique |
Bug Description
It seems /lib/lsb/
Without -p ${PID} "service capomastro status" will not check the right process and will probably return the wrong status of the service.
Related branches
lp:~roadmr/capomastro/init-papercuts
- Caio Begotti (community): Approve
-
Diff: 36 lines (+8/-7)1 file modifieddebian/capomastro.init (+8/-7)
Changed in capomastro: | |
status: | Triaged → In Progress |
assignee: | nobody → Daniel Manrique (roadmr) |
Changed in capomastro: | |
status: | In Progress → Fix Committed |
Changed in capomastro: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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.