Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: elevated privileges for a single call

by adalby (Initiate)
on May 07, 2013 at 16:21 UTC ( #1032505=note: print w/ replies, xml ) Need Help??

in reply to Re: elevated privileges for a single call
in thread elevated privileges for a single call

Thanks, Ken.

That gives me info on MY executing program. I need info on a different program.

To be specific, this is part of a script to monitor Oracle databases. Oracle can be installed multiple times on a server in multiple ORACLE_HOMEs. Each home can have zero or more running instances. I am trying to match the instances with the homes. Using the ps system call combined with grep I can find the PIDs of all the running instances. However, the cmd listed is just the basename, not the full path. WHICH doesn't help, since that just tells me the first exe resolved based on my PATH environment variable, not the particular copy that is executing. On Linux, the full path of executing processes are softlinked under /proc/$PID/exe. However, only the process owner and root can resolve the target of that link. I can sudo readlink (as in my script), but to do it in a shell script is ugly and/or AWKward. I would prefer to do it in perl, but I don't know how to sudo the readlink() function call.

Comment on Re^2: elevated privileges for a single call
Replies are listed 'Best First'.
Re^3: elevated privileges for a single call
by kcott (Canon) on May 12, 2013 at 15:04 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032505]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-10-10 20:49 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (258 votes), past polls