Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to start a service on startup of Solaris 8

Status
Not open for further replies.

MaxCrack

IS-IT--Management
Mar 19, 2001
5
US
We are running Uagent on the only UNIX box we have (so no one knows much about it) for tape backups. It's an Ultra 50 running Solaris 8. I need to know what file to edit and how to edit it, so that this service starts up when the system is started up.

The command to start it is "uagent start"

Thanks
 
Hi,
use editor vi and open a file named uagent_app in /etc/init.d dir and edit the following contents in it:
#!/bin/sh
case $1 in
'start')
echo starting uagent applications
uagent start
echo uagent started
;;

'stop')
echo stopping uagent applications
uagent stop
echo uagent stopped
;;
*)
echo "usage: `basename $0` {start|stop}"
;;
esac

Although I have just written uagent start and uagent stop,the best practice is to give full path name of uagent application(like /opt/bin/uagent start).
Then make a link of this file in /etc/rc0.d for stopping.Go to /etc/rc0.d dir then give the cmd
ln -s /etc/init.d/uagent_app K01uagent)
and another link in /etc/rc3.d for starting.Go to /etc/rc3.d dir and give the cmd
ln -s /etc/init.d/uagent_app S99uagent

So the next time u start the server your app. will start automatically.

I hope this helps.....
 
Place that script in /etc/init.d directory make a link to that file from rc0.d and rc2.d or rc3.d, the link will start with S?????? (startup) in the rc2.d or rc3.d. (levels 2,3) and K?????? (shutdown) in the rc0.d,rc1.d or rcS.d, they will be executed in alphabetical order, you can check “/etc/init.d” directory for script examples, i.e: to put your script starting in run level 2 after “nscd”, if your script is “/etc/init.d/uagent”, (don’t’t forget to make it executable):

#ln –s /etc/init.d/uagent /etc/rc2.d/S77uagent

Hope this helps,

Regards,

Carlos Almeida
 
sorry don't want respond after you NavinB (i don't add nothing new here), but when i checked it has 0 Threads...

Regards,

Carlos Almeida,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top