1833083 Members
4191 Online
110050 Solutions
New Discussion

run script

 
SOLVED
Go to solution
piyut_1
Frequent Advisor

run script

dear,

I have an application that will start with script startWeblogic.sh.I want this script automatically start when system boots to its multi user level.
I have placed this sript to /sbin/rc3.d.is it true??
for information,this script need username and password when run.

thanks,

-piyut-
10 REPLIES 10
Bharat Katkar
Honored Contributor
Solution

Re: run script

Hi Piyut,

You need to put the script in /sbin/init.d and then start it using the start script whose name is "S" and put this in /sbin/rc3.d.

Similarly stop script will be in /sbin/rc0.d and it's name will like "K"

If you have to provide Username/Password then you need to define varible with this and pass this variable to the calling script. Becuase it is not a good idea to make boot procedure interactive for your script.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Sunil Sharma_1
Honored Contributor

Re: run script

You can use su -c command to run this script as specific user.

This script should be placed in /sbin/init.d directory and should have symbolic link to /sbin/rc3.d directory. In rc3.d script name should start with S .

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
T G Manikandan
Honored Contributor

Re: run script

In your script in /etc/rc2.d which links to /etc/init.d

please use something like

/usr/bin/su - -c `$DOMAIN_HOME/start.sh` 2>/dev/null

where DOMAIN_HOME will point to your domain directory where the weblogic startup script resides
piyut_1
Frequent Advisor

Re: run script

dear,

there are informations in my server:
# ls /sbin/rc3.d/
S100nfs.server S200tps.rc S825apache S941opcagt S990dtlogin.rc

now, i just put script "startWeblogicstart.sh" to /sbin/init.d. to make link. I run command
#ln -s /sbin/init.d/startWeblogic.sh /sbin/rc3.d/S900startWeblogic.sh

is it true ???

but, this script need provide USERNAME and PASSWORD.hostname for this server that will run this script is hqhpux80 and username that will be provide is weblogic and password weblogic.

How can make this script so we don't need to provide username and password??

thanks,
Muthukumar_5
Honored Contributor

Re: run script

>#ln -s /sbin/init.d/startWeblogic.sh /sbin/rc3.d/S900startWeblogic.sh

It is correct. Are you using start, stop kind of startup scripts. Look into other scripts and make your new script as same to that.

>>>
but, this script need provide USERNAME and PASSWORD.hostname for this server that will run this script is hqhpux80 and username that will be provide is weblogic and password weblogic.
>>>

what kind of authentication and authorization. Is it your own one then it is easy. Else is it acceptable to give batch mode run.? If you can automate script without asking any question then that will be capable to put in boot-up scripts.

HTH.

Easy to suggest when don't know about the problem!
piyut_1
Frequent Advisor

Re: run script

how to make this script not to ask username and password???

Gordon  Morrison
Trusted Contributor

Re: run script

To stop the "su" command from asking the password, you'll have to run the script as root.
What does this button do?
piyut_1
Frequent Advisor

Re: run script

Mr gordon,

i have tried to start manually as root but still need provide username and password.how come ?
Gordon  Morrison
Trusted Contributor

Re: run script

Hi Piyut,
All I can think of is that the application you're starting with your script is asking for username & password. What happens when you try to start the application manually (without the script) as the owner of the application?
If it doesn't ask for the username & password when you do that, could you post the startup script?
What does this button do?
sreejith_4
Frequent Advisor

Re: run script

Hi,

I think there will be a Admin user for the particulation application which you are starting, as i understand it is weblogic. So if you login as that user . it will not ask you for authentication again

Thanks
Sreejith M