Bug 55954 - pidof -o option broken
pidof -o option broken
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: SysVinit (Show other bugs)
1.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-09 07:47 EST by Bernhard Rosenkraenzer
Modified: 2014-03-16 22:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-11-09 07:57:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernhard Rosenkraenzer 2001-11-09 07:47:18 EST
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 07:54:17 EST
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 07:57:52 EST
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 08:12:29 EST
Fixed in 2.79-2

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