LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Creating startup script

[ILUG] Creating startup script

Ciaran Johnston cj at nologic.org
Wed Oct 11 23:01:09 IST 2006


Conor Daly said:
> Best option would be to have a look at the startup scripts already in
> /etc/init.d (on linux systems at least, maybe someplace else on solaris).

They're there, alright, but they don't all play nicely. Some of them are
downright ugly. And on Solaris 10, the "rc*" stuff is gone (almost), to be
replaced by SMF. I'll assume the OP is using a Solaris version other than
10.

>
> Basically the startup script looks for the words 'start' and 'stop' as the
> first arg and do the daemon start or stop accordingly.  The script will
> usually create a file in /var/run/<script-name> to indicate that the
> daemon is running (some will put the daemon's pid in that file).  The
> 'stop' argument causes the daemon to be halted by whatever means works for
> that particular daemon.  For some if they are invoked with a stop switch
> will shut down, for others it's a matter of get pid from file and then do
> a 'kill <pid>'.

The "/etc/init.d/syslog" start script is a simple example of this on
Solaris 9, although it stores the PID in /var/run/syslog.pid and then uses
a symlink of that in /etc/syslog.pid - the behaviour is the same, though.

When you have a script in /etc/init.d/ with your start and stop cases
defined you should link it into the relevant rc directory (rc2.d in your
case) to start it and also any runlevels where you would like to stop it.

Bear in mind that the commands you are using below are "csh" syntax,
whereas most of the other start scripts you will see will be in bourne
shell ("sh", "ksh" or (rarely, on Solaris) "bash") syntax. You will need
to translate accordingly.

/Ciaran.

>
> Conor
>
> On Thu, Oct 12, 2006 at 02:27:03AM +0530 or so it is rumoured hereabouts,
> Walter Faleiro thought:
>> Hi,
>>
>> I need to fix a startup script in /etc/rc2.d for a solaris sytem for a
>> license server to be named say S99stabie.
>>
>> Following are the commands I use manually to start the daemon
>>
>> setenv SS_LICENSE_FILE /system/pkg/stabie/ssoft.lic
>> setenv SS_HOME /system/pkg/stabie/latest/sol64/ssoft
>>
>> set path=(/system/pkg/stabie/latest/sol64/ssoft/bin $path)
>>
>>
>>
>> % cd /tmp
>> % /system/pkg/stabie/latest/sol32/ssoft/bin/lsrv  &
>>
>> Can Someone guilde me with the building of statup scripts so the above
>> are
>> executed by a script when the system boots up.
>>
>> Thanks,
>> --Walter
>> --
>> Irish Linux Users' Group mailing list
>> About this list : http://mail.linux.ie/mailman/listinfo/ilug
>> Who we are : http://www.linux.ie/
>> Where we are : http://www.linux.ie/map/
>
> --
> Conor Daly <conor.daly at cod.homelinux.org>
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
> PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++
> ------END GEEK CODE BLOCK------
> http://www.geekcode.com/ http://www.ebb.org/ungeek/
> --
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/
>





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell