Re: [ILUG] Where to put jobs that start with boot-up

From: John P. Looney (john at domain antefacto.com)
Date: Sun 10 Jun 2001 - 00:29:13 IST


On Sat, Jun 09, 2001 at 09:22:06AM +0100, Oisin Kim mentioned:
> Hello all,
>
> I just need to be told that what I'm doing is OK and not
> dangerous/wrong/stupid! I need to set some PATH and JAVA_PATH variables and
> then start some servers before login so the machines will boot into a ready
> to work state.
>
> I have placed the following at the top of the file "/etc/rc.d/rc.local"
>
> ...
> echo "Setting PATH"
> export PATH=/usr/java/jdk1.3.1/bin:/usr/java/j2sdkee1.2.1/bin:/usr/orion:$PATH
> echo "Setting JAVA_PATH"
> export JAVA_PATH=/usr/java/jdk1.3.1
> echo "Starting Orion"
> sh /usr/scripts/startservers.sh
> sleep 7
> ...
>
> The sleep is just so I don't get the output of the last script telling me it
> has started in the middle of my login (I've set inittab to start the machine
> at run level 3)
>
> Is this the correct way to do this or is there a more proper / correct way?
>
> Thanks for any replies / help!

 It's not bad, but there is a better way.

 Init scripts are scripts run, once for each daemon. Have a look in
/etc/init.d or /etc/rc.d/init.d depending on the system you are running.
Try and hack together a script of your own, based on one of the old ones.
Stick the export JAVA... line & the path line in there.

 Then, to "enable" it, make symbolic links in /etc/rd?.d where '?' is 2 or
3. Doing;

 ln -s /etc/init.d/orion /etc/rc3.d/S40orion

 Will run "/etc/init.d/orion start" when you enter runlevel three, after
cron and before sshd - at least on my system, where there exists
/etc/rc3.d/S40cron and /etc/rc3.d/S51sshd. You get the idea.

Kate

-- 
 When I say 'free', I mean 'free': free from bond, of chain or command: 
to go where you will, even to Mordor, Saruman, if you desire. " 
    -- Gandalf, paraphrasing the choice between Free and Non-free software


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:36 GMT