SUMMARY :: su - <user > -c <command > permission problem.

From: <DYadav_at_docklands.vic.gov.au>
Date: Fri, 21 Dec 2001 12:04:06 +1100

thanks everyone .....I seams like I have to do some environment setting
manually. I'll try this after christmas ..thanks for the friends who
replied. Here is one of the solution I got.. ( "Davis, Alan" <Davis_at_tessco.com)


The typical reason that su'd scripts fail is because they don't get
the full environment of an interactive session.
 
Here's how I do it :
 
OENV=<path to user's env file>
APPUSER=<username of oracle acct>
FND_TOP=<path to top of binaries tree>
uSID=<oracle SID in uppercase>
/usr/bin/su - $APPUSER -c ". $OENV; \$FND_TOP/bin/start${uSID}mgr"
 
The important bit is the ". $OENV;" ahead of the command to execute. This
sources (in ksh) the users home environment file, ensuring that the script
gets the correct environment.

regards,

Dharmendra Yadav
---------------------------------------------------------------------------------
Oracle Database Administrator/Business Analyst
MELBOURNE DOCKLANDS AUTHORITY
Phone : +61 3 9628 4420 Mobile : +61 412 456 477


-----Original Message-----
From: DYadav_at_docklands.vic.gov.au [mailto:DYadav_at_docklands.vic.gov.au]
Sent: Thursday, December 20, 2001 6:05 PM
To: tru64-unix-managers_at_ornl.gov
Subject: su - <user > -c <command > permission problem.


>Hi wizkids,
> I want to add a scripts for Oracle Application and
Database
>on system (Tru64 , 5.1) shutdown/startup.
>These scripts works fine when I login to system as designated <oracle
>application user > user with no error.
>But when I added following line in script at /sbin/init.d/oraprod file
 
>( this is my linked file for statup & shutdown )
> su - <oracle user> -c <script path>
> they do not execute properly giving some permission error at certain
>part of the script.
Received on Fri Dec 21 2001 - 01:05:06 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT