From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2680c5dbf6527531 X-Google-Attributes: gidfee84,public From: "Adam Price" Subject: Re: rc3, init.d and starting things at bootime Date: 1999/05/06 Message-ID: <925970993.10924.0.nnrp-04.c2deb51d@news.demon.co.uk>#1/1 X-Deja-AN: 474622977 X-NNTP-Posting-Host: pappnase.demon.co.uk:194.222.181.29 References: X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 925970993 nnrp-04:10924 NO-IDENT pappnase.demon.co.uk:194.222.181.29 Newsgroups: comp.unix.osf.osf1 Brandon Hutchison wrote in message ... >I realise this is a pretty naive request but could somebody give me an >overview of how I get to automatically start something eg a webserver or >a licence server at boottime. > >I've found this directory /sbin/init.d which seems to contain scripts >for starting things and then there is the other one /sbin/rc3.d which >seems to contain links to the previous one. The links are named in >systematic ways starting with Snn.... where nn is a number. > >Do the scripts need to be written in any special way.. > >The man pages on all this are pretty detailed and I sort of need an overview. > >System: DEC Alphatstation running 4.0B DU. > >Thanks for your help.. > > Hi, init reads the inittab at boot and runs /sbin/rc3 at startup this runs each of the scripts named Sxxx in order (The order is ascii sort order, but because all of the scripts start with Snn they seem to run in numeric order, took me a while to realise why S100mystuff ran before S99stuff_i_depend_on) with the argument start. Because the scripts may need to be run at different run levels, it is good practice to put them in /sbin/init.d with a meaningful name and then place a symbolic link in /sbin/rcX.d, where X is the runlevel you want things to be started at. Normally the scripts are written so that when called with start as an argument they will start a service, and when called with stop as an argument they will stop it, however there is nothing to stop you writing two scripts to do this if you must. The scripts with the K prefix are run with a stop argument at shutdown(bit hazy here, may be on leaving the runlevel, long time since I looked) So the simple answer is no you don't need to write your scripts any special way, but if you do others may understand them better. Take one of the scripts which is already there, and rip it to pieces, put you own stop and start commands in the case statement, and don't forget about that ordering. Hope this helps Adam