List

This problem is solved thanks to Chuck Hamilton suggestion. I thank all the
list members who took their time in suggesting the solution.

Following is the solution given by Chuck Hamilton.

You can do what you want by using the setuid bit. On some version of unix
you may need a kernel parameter change to allow shell scripts to run with
the setuid bit turned on.

1. Log in as the "oracle" user.

2. Remove the password from the shell script and put it into a separate file
protected with unix permissions.
     echo "mypassword" > listener.pass
     chmod 600 listener.pass # Now only "oracle" can read this file

3. Change the line in your shell script to read the password  from the
listener.pass file. For KSH something like this works.
     lsnrctl <<! | grep ORCL # (or whatever service you're looking for)
     set password $(<listener.pass)
     status
     !

4. Change the permission on the shell script and add the setuid bit. This
causes the run-time user id to be set to the owner of the shell script
(which should also be "oracle").
     chmod u+s check_listener.sh
          or
     chmod 4755 check_listener.sh

Any user can now run the script, and even read the script, but can't see the
password because he can only cat the script, not the password file.

Thank You Chuk Hamilton.

Rao


[EMAIL PROTECTED]

Hi DBAs,

I would like to find out whether a specific listener service is up or not
without running the command ---> lsnrctl services.  Is there any way I can
do this through a shell script or unix command?

My environment : Solaris 2.7 : Oracle 8.0.4

Thanks for your help,

Rao

[EMAIL PROTECTED]

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rao, Maheswara
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to