Bug 55954 - pidof -o option broken
Summary: pidof -o option broken
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: SysVinit
Version: 1.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-09 12:47 UTC by Bernhard Rosenkraenzer
Modified: 2014-03-17 02:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-11-09 12:57:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Bernhard Rosenkraenzer 2001-11-09 12:47:18 UTC
Description of Problem:
The -o option of pidof is broken in 2.79-1.
This breaks the "status" function in /etc/init.d/functions, in effect 
breaking /sbin/service anything status.

Version-Release number of selected component (if applicable):
2.79-1

How Reproducible:
100%

Steps to Reproduce:
[root@spock sysconfig]# ps ax |grep bash
  945 tty1     S      0:00 -bash
 1225 tty2     S      0:00 -bash
27296 pts/5    S      0:00 -bash
14569 tty3     S      0:00 -bash
14658 tty3     S      0:00 /bin/bash /usr/bin/startkde
17586 tty4     S      0:00 -bash
20022 pts/1    S      0:00 /bin/bash
25052 pts/2    S      0:00 /bin/bash
27590 pts/3    S      0:00 /bin/bash
31359 pts/4    S      0:00 /bin/bash
32431 pts/1    S      0:00 grep --color=tty bash
[root@spock sysconfig]# pidof -o 20022 -o 25052 bash
31359 27590 25052 20022 14658


Actual Results:
31359 27590 25052 20022 14658

Expected Results:
31359 27590 14658


Additional Information:

Comment 1 Bernhard Rosenkraenzer 2001-11-09 12:54:17 UTC
This is on a full dist-8.0 system; might also be caused by a breakage in glibc 
2.2.4-20.2's getopt or the likes.


Comment 2 Bernhard Rosenkraenzer 2001-11-09 12:57:52 UTC
It's a bug in sysvinit itself.

 while ((p = get_next_from_pid_q(q))) {
       if (flags & PIDOF_OMIT) {
              for (i = 0; i < oind; i++)
                     if (opid[i] == p->pid)
                             continue;
	[...]
       }
       [print pid]
 }

Looks like someone forgot that continue; affects for() as well as while(). ;)
Fixing.


Comment 3 Bernhard Rosenkraenzer 2001-11-09 13:12:29 UTC
Fixed in 2.79-2



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