[Linux-disciples] Where to put startup instructions
Adam Rosi-Kessel
adam at rosi-kessel.org
Sun May 8 11:45:04 EDT 2005
On Sun, May 08, 2005 at 11:33:41AM -0400, Stephen R Laniel wrote:
> On Sun, May 08, 2005 at 11:25:59AM -0400, Adam Rosi-Kessel wrote:
> > So my guess would be put it in /etc/rcS.d, but I don't know if that is
> > "canonical."
> Just to reclaim a small bit of my Debian Manhood, I was
> aware of the /etc/init.d/-and-symlinks bit. But I think it's
> a little tricky, because I need to know when /proc is going
> to come up; only after it's up can I run the command I'm
> looking to run.
Note that rcS.d is a little different from rc#.d. I think it's that
rcS.d goes before any of the runlevels, but I may be missing some
subtlety.
> So I guess my question was: is there any good general method
> for figuring out which of the /etc/rcN.d directories a given
> command should go in, or do we have to figure it out in an
> ad-hoc way?
Well, in Debian we really don't have that many runlevels. There is 0
(halt) and 6 (reboot), which aren't relevant here. Then 1 is single user
mode, and 2-5 are all the same.
Commands are executed in alphabetical order for each runlevel. A command
(symlink) starting with 'S' will be called with 'start', with 'K' will be
called with 'stop' (as argument). Hence all the 'K's in /etc/rc1.d,
because in single user mode you shut most things down.
As far as echo-ing something into /proc, you just need to do it after
proc is mounted, which I believe will happen in
/etc/rcS.d/S35mountall.sh. So anything in any other runlevel, or after
S35, should work fine.
> I should be able to say, for instance, that your (Adam's)
> ssh-login-blocker script can only go in after sshd has
> started. I specify enough of these constraints ("only go
> in after daemon D_1," "only go in before daemon D_2," etc.),
> and Unix places the daemon in a position that's consistent
> with the constraints I've given (or tells me that my
> constraints are impossible to satisfy).
Actually, it doesn't matter when ssh_login_blocker starts--it doesn't
depend or expect the ssh daemon to be running first. So in this case you
could start it anytime after the filesystems are mounted.
> Anyway, that's the dream. I'll look around for a specific
> place to put this /proc instruction.
I would suggest /etc/rcS.d/S40proc or something like that.
--
Adam Rosi-Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050508/ed0d17ad/attachment-0001.pgp
More information about the Linux-disciples
mailing list