LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-08-2004, 08:29 PM   #1
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
startup script for Solaris


I am building a startup script for a service in Solaris

I have written a script and placed in in the appropriate folder (i think)
i have renamed it S70startup and placed it in the rc2.d rc3.d folder (i think this is correct I dont have the machine here with me now)

this is the format of the script
Code:
#!/sbin/sh
# Script

case "$1" in
 start)

   ;;

 restart)
   ;;

 stop)

   ;;

*)
 echo "Usage: $0 {start|stop|restart}"
 exit 1
 ;;
esac

exit 0
What i need to know is:
1 if this format is correct
2 where to place the files
3 anything else? I have heard about using inittab file but i though that was primarily used for System Services?

Thanks in advance
Chris
 
Old 03-08-2004, 09:48 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Well, you might think to consider when do you need the service to start, if it needs a completion of some services before it can be safely started, and so on, so place it in appropriate runlevel; and not to cluter your system pu it in /etc/init.d/ and make symbolic links like S71startup in the appropriate run level. The reason I said appropriate and before it can be safely started, conider the following, you are creating a startup script to mount remote shared with nfs, but if you do it before any networking service or more importantely nfs client starts you would not succeed, following me?
 
Old 03-08-2004, 09:51 PM   #3
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Original Poster
Rep: Reputation: 30
the script has no requirements like that.. just needs to be started on boot (before log in)

which number is that?
 
Old 03-08-2004, 11:22 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
well runlevel 3 will be appropriate ( /etc/rc3.d/ ), after all it never hurts to start it last, does it?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Password Shell Script Solaris 9 cpope67 Solaris / OpenSolaris 1 12-30-2004 03:15 PM
how to create initialising script in solaris please help pato Solaris / OpenSolaris 7 03-23-2004 03:46 AM
I need a Solaris 9 CHROOT script fishsponge Solaris / OpenSolaris 2 11-18-2003 05:45 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration