Bug 13189 - pidof -x fails with script name longer than 15 characters
Summary: pidof -x fails with script name longer than 15 characters
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: SysVinit   
(Show other bugs)
Version: 6.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
: 14226 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2000-06-28 16:41 UTC by Ron Isaacson
Modified: 2014-03-17 02:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-07-20 07:26:31 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Ron Isaacson 2000-06-28 16:41:56 UTC
If you run a {bourne, shell, etc.} script with a filename longer than 15 
characters, pidof -x will not find the running script.

To test, create a file called sleep.pl containing the following:

  sleep 60;

Then create two links to this file:

  ln -s sleep.pl 15xxxxxxxxxxxxx
  ln -s sleep.pl 16xxxxxxxxxxxxxx

Start the first script and look for its pid:

  ./15xxxxxxxxxxxxx &
  pidof -x 15xxxxxxxxxxxxx

pidof will return the correct pid of the running script. Then do the same 
with the second script:

  ./16xxxxxxxxxxxxxx &
  pidof -x 16xxxxxxxxxxxxxx

Now pidof returns nothing. This does not seem to be affected by the script 
interpreter, length of total path, or any other factors.

Comment 1 Bill Nottingham 2000-07-19 14:58:58 UTC
*** Bug 14226 has been marked as a duplicate of this bug. ***

Comment 2 Bill Nottingham 2000-07-20 07:26:29 UTC
It's because it's looking at the /proc/stat field for that process, and
the field name for the command line is truncated at 15 characters.

Comment 3 Bill Nottingham 2000-08-06 06:25:30 UTC
... and since the field name is coming from the kernel,
there's very little SysVinit can do about it.

Note You need to log in before you can comment on or make changes to this bug.