Cron running as wrong user
I have a newly set up Red Hat 6 server I am trying to get up and running.
On it I have 2 users oracle and grid. I log in as the oracle user and set up a cron to do a nightly data transfer. All stuff I have done many times. The script is getting executed as the grid user somehow. I can't figure this out. I checked /var/log/cron and you can see oracle as the user executing the cron job. I added the sourcing of the .bash_profile in the oracle users home in the script. It fails because it has no permissions. This seems clear to me that the execution environment is as if the grid user is running it. There is nothing in the crontab for the grid user. Does anyone have any idea of something I am missing? Or anything else I can check? Thanks Neil |
if the two users had the same user id. I would add set -xv at the beginning of the script and save the output. Also add some commands like id, date. Is there a setuid app somewhere there?
|
The grid user has the same uid as the oinstall group. The oinstall group is the primary group for both users. Could that be doing it?
I guess change the uid for the grid user? |
Cool command. It gave me all sorts of useful information.
It didn't help though. When I log in as Oracle and run the same command using "at now" it works perfectly. When it gets called from the cron it seems to run as the wrong user still. |
It is so strange I ran the script again forcing it to the correct working directory.
cd /home/oracle/etlprocess One of the files it wrote out had the owner and group as: oracle asmadmin The oracle user is not even in that group. Typical owner and group is: oracle oinstall |
All times are GMT -5. The time now is 01:12 PM. |