OpenSolaris

Printable Version Enter a New Search
Bug ID 6475920
Synopsis pidof doesn't work in lx branded zones
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:brandz
Keywords
Responsible Engineer Edward Pilatowicz
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_56
Fixed In snv_56
Release Fixed solaris_nevada(snv_56)
Related Bugs 6485372
Submit Date 27-September-2006
Last Update Date 25-January-2007
Description
the pidof command in linux doesn't seem to work in lx branded zones.
this command is used by things like the Red Hat up2date tool and init.d
scripts.  here's an example of the failure:
---8<---
edp@secrassic$ /etc/init.d/sshd status
pidof: can't read sid for pid 4276

pidof: can't read sid for pid 4277

sshd (pid 25683) is running...
---8<---
so the pids that pidof is complaining about are native processes in the
zone.  specifically these are the pids of the statd and lockd daemons.
the problem is that pidof calls emulation code that tries to translate
the linux pid into a solaris pid via a call to lx_lpid_to_spair().
this fails for these pids since they are native processes and never
had their pids entered into the linux-to-solaris pid hash table (ltos_pid_hash)

the solution it to make lx_lpid_to_spair() smarter.  after it looks in the
hash table, if it doesn't find anything it should check if the supplied
pid is running in the current zone.  if it is then it's a native process and
the pid should just be returned as is (without any translations.)
Work Around
N/A
Comments
N/A