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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start a process automatically 2

Status
Not open for further replies.

lamsf

Technical User
Jul 27, 2003
103
0
0
US
I hv a Sun server running on Solaris 10.
My question is, what do I do so that everytime when the Sun server boots up, some processes are started automatically?

I think, in Linux, I can put in the command in a file called rc.local. Is there any similar file in Solaris 10?

Thank you.
 
Not sure whether they've changed it in 10, but earlier versions used files usually in /etc/rc2.d and /etc/rc3.d (ideally links to /etc/init.d) for this.

I want to be good, is that not enough?
 
also check
#svcs -a

use: svcadm command to set if need be.

For Solaris 10, Sun is attempting to get away from the init scripts and replace it with what they call SMF.

if you are talking about home grown scripts needed at boot time, than Ken's post is what you want to do, unless you have time to convert your scripts into SMF and let Solaris manage it.



David
 
Thanks for the clarification, David, I thought I recalled something about that, but I haven't played with Sol 10 as yet.

I want to be good, is that not enough?
 
Thanks for the reply.
Actually, I would like the vnc to startup automatically after the server is booted. What is the best way to do this?
Thanks.
 
Create a script called /etc/rc3.d/S99vncserver containing just the following:

Code:
/usr/local/bin/vncserver

Obviously change the path to where your vncserver binary is located. Then make it executable using chmod 755 /etc/rc3.d/S99vncserver.

Annihilannic.
 
Thanks.
Do I need to create another script to kill the vnc process, like K99vncserver or something?
 
That would be a good idea to be clean. In that case, I would create a script in /etc/init.d/vncserver containing something like:

Code:
case "$1" in
    start)
        /usr/local/bin/vncserver :2
        ;;
    stop)
        /usr/local/bin/vncserver -kill :2
        ;;
esac

Then create symbolic links using the following:

Code:
ln -s /etc/init.d/vncserver /etc/rc3.d/S99vncserver
ln -s /etc/init.d/vncserver /etc/rcS.d/K00vncserver
ln -s /etc/init.d/vncserver /etc/rc0.d/K00vncserver
ln -s /etc/init.d/vncserver /etc/rc1.d/K00vncserver
ln -s /etc/init.d/vncserver /etc/rc2.d/K00vncserver

I have specified the display number explicitly because you need to know in advance which one you are going to kill.

Annihilannic.
 
Okay, just a bit off topic, but I thought it would go well with this specific thread...

As Solaris 10 uses services/SMF instead of (or in association with more legacy) rc scripts, should admininstrators begin migrating to SMF?

That said, I personally like the rc scripts. (Annihilannic's post is a textbook perfect example.) Then again, I liked the legacy rc scripts from SunOS....

What do you think?
 
Since I work with many flavours of Unix I prefer to stick with the more 'standard' way of doing things than proprietary things like SMF. I haven't managed SMF services enough yet to be completely comfortable with them, and haven't the foggiest how to add a new one. If it ain't broke...

I'd be keen to hear of SMF's advantages though if there are any fans here?

Annihilannic.
 
Another question. I hv this Sunfire T2000, which everytime after power trip, it will auto reboot upto the ALOM, then it will wait for someone to telnet/console in and fire it up with "poweron" command to proceed. Is there something I can do so that the server will automatically boot up completely (do not require the "poweron" step)?

Thanks...
 
Hi. Oddly enough I'm just starting to work on a T2000 (very pretty isn't it?). Not sure whether this thread:

Thread-1250797

will help?

I want to be good, is that not enough?
 
Change auto-boot-on-error?=false to
auto-boot-on-error?=true


David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top