pid's of processes which open a pipe (or fd descpition)

Hello.

I have a problem with identification of process, which open pipe with

other one. for exaple i run

# ./a | tee > /tmp/a

and i see

# ls -al /proc/<pid_of_tee>/fd/

dr-x2 antonyother8208 Feb 26 16:21 .

dr-x--x--x5 antonyother864 Feb 26 16:21 ..

p0 antonyother 0 Feb 26 16:34 0

--w-1 antonyother160 Feb 26 16:34 1

c1 antonytty24, 2 Feb 26 16:21 2

Ok. I see that 0 stream is a pipe. But how can i detect with with process

this pipe is opened?

In Linux, for example, with the same example i have:

dr-x 2 antony antony 0 2006-02-26 16:24 ./

dr-xr-xr-x 4 antony antony 0 2006-02-26 16:24 ../

lr-x 1 antony antony 64 2006-02-26 16:24 0 -> pipe:[26606]

l-wx 1 antony antony 64 2006-02-26 16:24 1 -> /tmp/a

lrwx 1 antony antony 64 2006-02-26 16:24 2 -> /dev/pts/4

Ofcouse more detailed output but what 26606 mean?

And what about other fd's? Ok, in Linux its a symbolic link to file and

what about solaris? What format of this file and where it is described?

[1111 byte] By [apex] at [2007-11-25 23:40:41]
# 1
try using "lsof" utility. you can download it from sunfreeware.com
kirilln at 2007-7-5 18:48:27 > top of Java-index,General,Sys Admin Best Practices...
# 2
Hi,You can use the following command to get PID. Just fill the var szProcessName with the name of you process.ps axw | grep -m 1 \""+ szProcessName + "\" | grep -v \"grep\" | awk '{print $1}'Philipina
Philipina at 2007-7-5 18:48:27 > top of Java-index,General,Sys Admin Best Practices...
# 3
hello pilippinai see, you not discovered /bin/ps and use still ucb/version ... on solaris >6:((((suppose my user-name is 'greppone' and i started a script called './dogrepme'what is your grep grepping for ?
armena at 2007-7-5 18:48:27 > top of Java-index,General,Sys Admin Best Practices...
# 4
is /usr/proc/bin/pfiles not an approach ?
armena at 2007-7-5 18:48:27 > top of Java-index,General,Sys Admin Best Practices...
# 5

fuser(1m) (/usr/sbin/fuser) is the tool to use to see what process has a particular file open.

$ /usr/sbin/fuser /var/adm/messages

/var/adm/messages:465o

but Solaris doesn't have quite the same 'richness' in /dev/fd/ or /proc/<pid> as you're perhaps used to with Linux.

For information on the files in /dev/fd, look at the manual page fd(4).

jrg_work at 2007-7-5 18:48:27 > top of Java-index,General,Sys Admin Best Practices...