Source: percona-toolkit
Version: 3.7.1-3
Usertags: pidof-without-procps
Dear maintainer(s) of percona-toolkit,
it appears that percona-toolkit uses `pidof` in its testsuite, or that
at least one of its binary packages uses `pidof` at runtime.
Historically, `pidof` was provided by the Essential package
`sysvinit-tools`, making an explicit dependency unnecessary. However
`pidof` will soon be moved to `procps` and will no longer be part of
the Essential set.
Please add an explicit dependency on `procps`:
* via the `Depends:` field of all binary packages of percona-toolkit
that use `pidof` at runtime;
* via the `Build-Depends:` field of percona-toolkit, if `pidof` is
used in tests run at build-time;
* via the `Depends:` field of `debian/control/tests`, if `pidof` is
used in autopkgtests.
To prevent any disruption for users of percona-toolkit, please add
this dependency now, before `pidof` is moved from `sysvinit-utils` to
`procps`. Alternatively, you could remove all uses of `pidof`.
It is believed that percona-toolkit uses `pidof` due to the following
code snippets:
```
path: percona-toolkit_3.7.1-2/lib/bash/collect_mysql_info.sh
local JEMALLOC_LOCATION=''
for pid in $(pidof mysqld); do
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null
| grep -qc jemalloc
jemalloc_status=$?
path: percona-toolkit_3.7.1-2/lib/bash/collect_mysql_info.sh
local variables_file="$1"
local pids="$(_pidof mysqld)"
if [ -n "$pids" ]; then
path: percona-toolkit_3.7.1-2/bin/pt-pmp
# There are no files to analyze, so we'll make one.
if [ -z "$OPT_PID" ]; then
OPT_PID=$(pidof -s "$OPT_BINARY" 2>/dev/null);
if [ -z "$OPT_PID" ]; then
OPT_PID=$(pgrep -o -x "$OPT_BINARY" 2>/dev/null)
path: percona-toolkit_3.7.1-2/bin/pt-pmp
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/bin/pt-sift
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/bin/pt-stalk
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/lib/bash/collect.sh
collect_mysql_data_one() {
# Get pidof mysqld.
if [ ! "$OPT_MYSQL_ONLY" ]; then
port=$($CMD_MYSQL $EXT_ARGV -ss -e 'SELECT @@port')
path: percona-toolkit_3.7.1-2/bin/pt-summary
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/bin/pt-mysql-summary
local JEMALLOC_LOCATION=''
for pid in $(pidof mysqld); do
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null
| grep -qc jemalloc
jemalloc_status=$?
path: percona-toolkit_3.7.1-2/bin/pt-mysql-summary
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/bin/pt-mext
}
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
path: percona-toolkit_3.7.1-2/lib/bash/alt_cmds.sh
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
path: percona-toolkit_3.7.1-2/bin/pt-ioprofile
_pidof() {
local cmd="$1"
if ! pidof "$cmd" 2>/dev/null; then
ps -eo pid,ucomm | awk -v comm="$cmd" '$2 == comm { print $1 }'
fi
```
Feel free to close this issue if this is a false positive (for example
if this code is in an unreachable code path).
Regards,
--
Gioele Barabucci