How to check for open file descriptor for a running process

Hi,

I am having a similar situation like this one here

https://www.dbi-services.com/blog/oracle-12-2-how-to-rotate-the-12-2-listener-log-diag_adr_enabled_listener-off-follow-up/

However, when I run the lsof -p, I am getting the error below

lsof: can't stat(/devices): No such file or directory

I am on Solaris version SunOS [hostname] 5.11 11.4.77.182.2 sun4v sparc sun4v non-global-zone

Is it because I am on the zone and not on the LDOM :frowning:
Is there another way of checking if there is an open file descriptor associated to a process?
I do not have sudo access.

Had also checked /process/[pid]/fd, there are several files there, I thought there should just be one :frowning:

Please advise. Thanks.

Solaris has
pfiles

But lsof -p should actually work ... Maybe it is too slow to be useful.

I am getting an error running lsof -p for Solaris. I think maybe because I am the local zone. I've no access to the global zone :frowning:

I was able to run pfiles but I can't see which file descriptor is assigned to the log.

I am trying to simulate whether the behavior that the author presented on his article will have the same behavior in Solaris when I do a mv of the file. I'll search further. Thanks.

If you know the log file then you can run fuser on it to get the PID.
Its output is partly stdout and partly stdin.

pids=$(fuser /path/to/listener.log 2>/dev/null)
echo "$pids"