Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 avoiding work at the Monastery: (6)
As of 2015-11-26 16:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (701 votes), past polls