1834071 Members
2589 Online
110063 Solutions
New Discussion

cron user on cluster FS

 
David_246
Trusted Contributor

cron user on cluster FS

We have a user oracle whose home-directory resides within the Cluster package.
Now the user oracle runs a script every two hours using cron.
I build a script to check if the package is on the current node, if not --> just exit, If so execute the script. No big deal.

00 * * * * /usr/local/bin/check.sh

But cron complains even before it tries to execute the script. Cron gives the error that the current users homedir is not available and does not execute (sends an e-mail). As the homedirectory from oracle resides on the Cluster Filesystem.

So there will be always an error e-mail generated by cron, even if I would just perform a bdf and redirect it to /dev/null. This is what we just wanted to get rid of.

Does anyone know how to disable this anoying cron check for homdir precense? I cannot imagine there is no-one else there that haven't met the same problem.

Thanks for your help in advance.

Regs David
@yourservice
4 REPLIES 4
Ralph Grothe
Honored Contributor

Re: cron user on cluster FS

Although this may not be sophisticated enough,
couldn't you just create a home directory for the user who needs the cron job to be run in the / filesystem?
How about putting an
rmdir -p /path/to/users/home
(if you don't need it as a mount point for the package's LV)
in the customer_defined_run_cmds()
and a
mkdir -p /path/to/users/home
in the customer_defined_halt_cmds()
functions of the respective package control script,
just to satisfy cron?
Madness, thy name is system administration
Hai Nguyen_1
Honored Contributor

Re: cron user on cluster FS

Dave,

A home directory for a user is required for his cron to be executed.

One way to get around is creat a cron for root to check if the home dir exists. If so, execute the above script as oracle (using the su command.)

Hai
Marco Santerre
Honored Contributor

Re: cron user on cluster FS

Though I don't use a script and cron in a similar way that you present, I would be tempted to suggest to you that instead of looking for the home directory, why don't your script checks the cmviewcl to see what node the package is running. What I mean, is that your /oracle home directory must be defined within a package, if that package runs on node A, then you know /oracle home is located on node A. If it has switched to node B, then you know /oracle home is on node B. So if you grep for your package name in cmviewcl, the 5th parameter will tell you which node it is running on.
Cooperation is doing with a smile what you have to do anyhow.
John Palmer
Honored Contributor

Re: cron user on cluster FS

How about creating a dummy home directory within the cluster mountpoint, do this on al nodes.

e.g.
Home dir is /oracle/home, mountpoint is /oracle.

With /oracle unmounted, mkdir /oracle/home.

That way you have a valid home directory whether /oracle is mounted or not.

Regards,
John