bugSystem V style init programs - Bugs: bug #47196, pidof: matches wrong process when...

 
 

bug #47196: pidof: matches wrong process when full path is given if process is invoked without path elements

Submitter:  Steve Beattie <sbeattie>
Submitted:  Thu 18 Feb 2016 10:38:14 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Feb 2018 02:39:39 AM UTC, comment #1: 

This bug has been fixed in the git beta branch and should be included in the 2.89 release.

Jesse <newguy>
Group administrator
Thu 18 Feb 2016 10:38:14 PM UTC, original submission:  

(This is a forwarded bug report from launchpad https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1546126 )

pidof will display the wrong process pid in the following situation:

  sleep 5 & pidof /wrongdir/sleep

even though the invoked sleep command is found on path as /bin/sleep. On linux kernels, /proc/PID/exe will point correctly to /bin/sleep (killall5.c:pidof() already attempts to look at this proc entry at least for binaries on nfs paths).

/wrongdir/sleep could be another executable, but the above happens even if the file or even the /wrongdir does not exist.

However, if sleep was called with full path
$(command -v sleep) 5 & pidof /wrongdir/sleep
pidof does not display anything, which is expected.

Steve Beattie <sbeattie>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by newguy (Posted a comment)
  • -email is unavailable- added by sbeattie (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-28 newguy StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code