Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21191 - "pidof -s <program>" fails
Summary: "pidof -s <program>" fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-18 11:50 UTC by Graham Ashton
Modified: 2003-08-04 14:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Ashton 2003-05-18 11:50:06 UTC
pidof doesn't behave when called with the -s argument. For example:

hoopoo root # pidof init
1
hoopoo root # pidof -s init
init: unknown signal; killall -l lists signals.
hoopoo root # pidof nautilus
1373 1384 1385 1386 1387
hoopoo root # pidof -s nautilus
nautilus: unknown signal; killall -l lists signals.

With -s it should return 1 in the first example, and 1373 in the second. I just
remerged the psmisc package, but it didn't help.

My box is fully up to date, and was originally made from the first Gentoo Live
CD to include UT2003 (which I think was rc1). I'm using GCC 3.2.2.

hoopoo root # gcc-config --get-current-profile
i686-pc-linux-gnu-3.2.2

Gentoo is a wonderful system, by the way.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-05-18 16:57:28 UTC
any ideas guys ?
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2003-05-19 15:37:25 UTC
Here is the issue:

1) We have two pidof apps ... one from sysvinit in baselayout and the other
   from psmisc.

2) Only the one from baselayout installs a manpage.

3) The default one running is the one from psmisc, as /bin is searched
   before /sbin:

    # pidof --usage
    usage: pidof [ -eg ] name ...
           pidof -V

        -e      require exact match for very long names;
                skip if the command line is unavailable
        -g      show process group ID instead of process ID
        -V      display version information

  and it actually seems to work fine:

    # pidof bash
    7683 7904 7948 7999 8044 8090 8139 8190 8243 8298 8355 8414 8475 8541 8588 8639 29576 29644 14121

4) /sbin/pidof from baselayout (sysvinit) that the manpage is actually for,
   do work fine:

    # PATH=/sbin pidof bash
    23608 14131 14130 14121 14105
    # PATH=/sbin pidof -x bash
    23608 14131 14130 14121 14105 29644 29576 8639 8588 8541 8475 8414 8355 8298 8243 8190 8139 8090 8044 7999 7948 7904 7683
    # PATH=/sbin pidof -s bash
23608

Thus I guess the obvious fix is to remove pidof from psmisc ...
Also, we should prob have psmisc install a symlink to ../sbin/pidof
to make sure nothing breaks with /bin/pidof missing.


Comments ?
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-08-04 14:14:16 UTC
Fixed in -r3.