1755716 Members
2810 Online
108837 Solutions
New Discussion юеВ

Re: cntl script

 
toni osta
Frequent Advisor

cntl script

Hi

i need to put two scripts under the function customer_defined_run_cmds

i have two scripts each one should run with different user
one begin with su - ora (user ora ) and the other after the first one su -esc (user esc)
but when finishing the first script , it could ask for the password of the second user ,
how can i eliminate the need to ask for the password of esc user
could the command exit between these two scripts do this task ?

Thank you
4 REPLIES 4
Michal Kapalka (mikap)
Honored Contributor

Re: cntl script

hi,

uncomment the customized script and try tu start the cluster, and them execute the scripts manually.

if you run as the root the second script from command line, is the password required ???

because id you are root, and use su - the password will be ignored.


mikap
Turgay Cavdar
Honored Contributor

Re: cntl script

Just add two lines, as the user root runs it, will not ask any password:
su - user1 -c "/script1"
su - user2 -c "/script2"
toni osta
Frequent Advisor

Re: cntl script

sure it is working manually as root and dont ask for password
but what i want is to integrate them in the package cntl file of the cluster
Horia Chirculescu
Honored Contributor

Re: cntl script

Hello,

Edi you pakage control script in oredr to define a new function pkg_start.sh

function customer_defined_run_cmds
{
/etc/cmcluster/pkg_start.sh

test_return 51
}

/etc/cmcluster/pkg_start.sh will run as root, so su will not ask for a password.

(Of course you can use any path you would like, not only /etc/cmcluster)

Edit pkg_start.sh to run the commands as required:

su - ora -c "/path_to/youscript1.sh"
su - esc -c "/path_to/youscript2.sh"

Horia.
Best regards from Romania,
Horia.