RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1262857 - 'pidof -m' option gives inavlid option error
Summary: 'pidof -m' option gives inavlid option error
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sysvinit
Version: 6.7
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-14 13:38 UTC by Soumya
Modified: 2015-09-16 11:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-16 11:37:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CentOS 9321 0 None None None Never

Description Soumya 2015-09-14 13:38:11 UTC
With package initscripts-9.03.49-1.el6.centos.x86_64, there is an addition of -m option in function __pids_pidof, in file /etc/rc.d/init.d/functions

-------------------------
183 # Output PIDs of matching processes, found using pidof
184 __pids_pidof() {
185 pidof -c -m -o $$ -o $PPID -o %PPID -x "$1" || \
186 pidof -c -m -o $$ -o $PPID -o %PPID -x "${1##*/}"
187 }
-------------------------

But pidof command isn't recognizing the -m option, though the rpm changelog shows -m option is added.

------------------------
$ pidof -c -m -o 41849 -o 41842 -o %PPID -x SRVC
pidof: invalid options on command line!

$ rpm -qf /sbin/pidof
sysvinit-tools-2.87-6.dsf.el6.x86_64

$ rpm -q --changelog sysvinit-tools-2.87-6.dsf.el6.x86_64 | head -4
* Thu Feb 26 2015 Lukáš Nykrýn <lnykryn> - 2.87-6.dsf
- pidof: add -m option (#883857)
- count with deleted binaries (#760251)
------------------------

Because pidof command gives invalid option error, its not possible to cleanly restart a service [leading service instability].

Comment 2 Lukáš Nykrýn 2015-09-15 13:16:59 UTC
Hmm I can't reproduce the issue:

[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[1] 1428
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[2] 1437
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[3] 1448
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[4] 1461
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[5] 1471
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[6] 1481
[lnykryn@notas src(rhel-6.7)]$ sleep 30 &
[7] 1490
[lnykryn@notas src(rhel-6.7)]$ ./pidof -c -m -o 1428 -o %PPID -x sleep
[lnykryn@notas src(rhel-6.7)]$

Comment 3 Lukáš Nykrýn 2015-09-15 13:49:46 UTC
and one more test on rhel6 machine:
[root@rhel6 init.d]# rpm -q initscripts sysvinit-tools
initscripts-9.03.49-1.el6.x86_64
sysvinit-tools-2.87-6.dsf.el6.x86_64
[root@rhel6 init.d]# . /etc/init.d/functions 
[root@rhel6 init.d]# sleep 600 &
[3] 1412
[root@rhel6 init.d]# sleep 600 &
[4] 1413
[root@rhel6 init.d]# sleep 600 &
[5] 1414
[root@rhel6 init.d]# sleep 600 &
[6] 1415
[root@rhel6 init.d]# set -x
++ printf '\033]0;%s@%s:%s\007' root rhel6 /etc/init.d
[root@rhel6 init.d]# __pids_pidof sleep
+ __pids_pidof sleep
+ pidof -c -m -o 1379 -o 1375 -o %PPID -x sleep
1415 1414 1413 1412 1405 1404
++ printf '\033]0;%s@%s:%s\007' root rhel6 /etc/init.d

Comment 4 Soumya 2015-09-16 11:27:13 UTC
Ohh, I think I got the issue.. So I installed virtuozzo on top of centos 6.7.. which changes /sbin/pidof:

Earlier:

--------------
[root@ ~]# which /sbin/pidof
/sbin/pidof
[root@ ~]# rpm -qf /sbin/pidof
sysvinit-tools-2.87-6.dsf.el6.x86_64
[root@ ~]# ls -al /sbin/pidof
lrwxrwxrwx. 1 root root 8 Sep 16  2015 /sbin/pidof -> killall5
[root@ ~]# 
--------------

Post virtuozzo installation:

--------------
[root@ ~]# which /sbin/pidof
/sbin/pidof
[root@ ~]# rpm -qf /sbin/pidof
sysvinit-tools-2.87-6.dsf.el6.x86_64
[root@ ~]# ls -al /sbin/pidof
lrwxrwxrwx. 1 root root 8 Sep 16  2015 /sbin/pidof -> /sbin/vzpidof
[root@ ~]# rpm -qf /sbin/vzpidof
vz-redhat-compat-4.6.0-5.x86_64
--------------

So its an issue with the vz package.

Sorry for the trouble, and thanks for your time  Lukáš Nykrýn

Comment 5 Soumya 2015-09-16 11:30:46 UTC
CLOSED

Comment 6 Lukáš Nykrýn 2015-09-16 11:37:20 UTC
Never mind, glad to help.


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