Re: [S.u.S.E. Linux] A Standard for rc.local ?? (suse 5.2 )
The principle is very easy:
you put your "switch" in /etc/rc.config... like this:
blah...
#
# Do you want to run my daemon ?
#
START_MYDAEMON="yes"
then, you add your script in /sbin/init.d/
(copy /sbin/init.d/skeleton to /sbin/init.d/mydaemon and edit it)
and you do this:
#
...
. /etc/rc.config
if [ "$START_MYDAEMON" != "yes" ]
then exit
fi
...
and put the proper commands under start and stop
and the last step is...
decide at which runlevel your script should be started...
let's say 2 (because we assume it's a network daemon here ;-))
and, inside this runlevel, decide when it should be launched...
like this:
/sbin/init.d# ln -s mydaemon rc2.d/S80mydaemon
/sbin/init.d# ln -s mydaemon rc2.d/K10mydaemon
Like this, it'll be started almost at the end and it'll be killed almost at
the beginning...
you have to coordinate this with the other links in rc2.d/
It works like this:
when you switch to runlevel 2, the rc script will execute every file linked
in /sbin/init.d/rc2.d/ that starts with S (like Start), sorted (S01xxx will
be run before S02xxx, ...), with "start" as argument
when you switch down from runlevel 2, the rc script will execute every file
linked in /sbin/init.d/rc2.d/ that starts with K (like Kill), sorted (K01xxx
will be run before K02xxx, ...), with "stop" as argument
Isn't that easy enough ? ;-)
Pascal
/nick SuSE52 on #linux (IRCnet)
root on www.student.prov-liege.be
-----Original Message-----
From: Eduardo Romero
Hi: I installed to use suse 5.2 few days ago ( since 1995 i did use redhat and before this... transmeritech :) ). Well, i was looking the standard
work for yast and suseconfig, but rc.d doesn't found a predeterminate rc.local style of redhat or solaris/sun. I would like to get some points tips for a future /sbin/init.d/local script. My idea is use rc.config like a startup options always, and a second idea for create a sshd startup
of script
in the same directory ( create a sshd-suse.rpm with ths standard ).
TIA!.
Saludos Edo. Valparaiso-Chile. -- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
-- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
The principle is very easy:
you put your "switch" in /etc/rc.config... like this:
blah... # # Do you want to run my daemon ?
Yes, i understood this ( i did similar things in irix ,because don't have a rc.local file ), but the idea is to put things that don't need a stop procedure (i.e Modify a etc/motd or issue, put a ipfwadm -I -l , etc). In a few words.. a rc.local file that you add commands in easy standard ( ref. rh 4.2 , rh5.0 ).
Isn't that easy enough ? ;-)
Well I'll build a sshd rpm package for test one.
Pascal
Saludos Edo. -- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi! Trying to kill the keyboard, edo@ce2usm.valparaiso.cl produced:
you put your "switch" in /etc/rc.config... like this: [snip]
Yes, i understood this ( i did similar things in irix ,because don't have a rc.local file ), but the idea is to put things that don't need a stop procedure (i.e Modify a etc/motd or issue, put a ipfwadm -I -l , etc).
Well, I'd use a dummy stop procedure ... like start) # some commands like setting HD parameters ... only in runlevels # 2 and 3, so if it really fails, I can still use runlevel 1 echo "blahing blah" blah -b -l -a -h --blah ;; stop) # dummy ;; -Wolfgang -- PGP 2 welcome: Mail me, subject "send PGP-key". If you've nothing at all to hide, you must be boring. Unsolicited Bulk E-Mails: *You* pay for ads you never wanted. Is our economy _so_ weak we have to tolerate SPAMMERS? I guess not. -- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
participants (3)
-
edo@ce2usm.valparaiso.cl
-
pbleser@prov-liege.be
-
weissel@jupiter.ph-cip.uni-koeln.de