Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which init scripts go in which runlevels?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Jul 13, 2006 10:59 pm    Post subject: Which init scripts go in which runlevels? Reply with quote

I've had my Gentoo system for almost a year now, and I recently had to fix the "Broken runlevel entry" problem that many people have already posted about (just do a quick search for those words if you haven't seen the relevant threads). But after deleting and re-adding the scripts to the (supposedly) appropriate runlevels, I noticed that my domainname script is in both boot and default (it was actually that way before I fixed the problem, too). This seems to be atypical, shall we say, since everyone else's output of rc-update show I've seen in the forums has it only under one or the other. But that's the problem: some people have it in boot, some in default. So how am I supposed to know which runlevel it should be in? More generally, how do I know where any of my init scripts belong? Or even which ones I should or shouldn't be using? Is there an official source for such info? man rc-update didn't seem to help...

- dcljr

Edit: And the Initscripts chapter of the (for me, x86) Handbook, while relevant, is a bit dense and doesn't seem to address my question(s) directly.
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Thu Jul 13, 2006 11:21 pm    Post subject: Reply with quote

Maybe this will shed some light on how the whole system works and what the levels are for
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Jul 13, 2006 11:36 pm    Post subject: Reply with quote

Zepp, you must have been typing your reply just as I was adding the "Edit" to my message above. I did think to look at that exact page after I posted my original message, but it's far too general for what I'm talking about. It doesn't say things like, "The domainname script should be placed in the boot runlevel if <such-and-such-is-true>." Is there any such documentation out there?

- dcljr
Back to top
View user's profile Send private message
dcljr
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 139
Location: Austin, TX

PostPosted: Thu Jul 13, 2006 11:44 pm    Post subject: Reply with quote

Well, looky there...
Code:
~ # cat /etc/init.d/domainname
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
        need checkroot hostname
        before bootmisc
}

Since I see the bootmisc script in my boot runlevel, I guess that answers one of my questions!

My more general questions still stand, though.

- dcljr
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Fri Jul 14, 2006 6:48 am    Post subject: Reply with quote

From my understanding for most things it is really up to what you feel is appropriate. Of course certain things have to come before others like mounting file systems and such and dependencies as mention. But beyond that I think you can bring them up in what order you feel is good. I don't think there are anything that says concretely that this initscript must be run at this level, just that in some cases this service may require other services, so you just have to ensure they are run prior to.
Back to top
View user's profile Send private message
rafo
Apprentice
Apprentice


Joined: 18 Nov 2003
Posts: 161
Location: Sollentuna, Sweden

PostPosted: Wed Aug 16, 2006 11:42 am    Post subject: Reply with quote

I think dcljr's comment is quite valid. While it is true that Linux distributions in general, and Gentoo probably more than most, can be set up in a wide variety of ways, it would be useful to have a description of runlevels in a middle-of-the-road Gentoo installation.

This would in no way be meant to stop people from arranging their own runlevels; it would just be a piece of documentation to refer to when in doubt.

One may argue that there is no such as thing as a middle-of-the-road Gentoo installation. Well, then start from a virgin stage3 installation and add a bunch of commonly used daemons in a sensible fashion. If certain daemons could go in different runlevels, then explain the pros and cons.

I was sort of looking for that kind of documentation since I didn't immediately know where to have "domainname" launched. And I ended up in this thread.
Back to top
View user's profile Send private message
rafo
Apprentice
Apprentice


Joined: 18 Nov 2003
Posts: 161
Location: Sollentuna, Sweden

PostPosted: Wed Aug 16, 2006 11:57 am    Post subject: Reply with quote

I just learned that domainname has been dropped from Gentoo altogether. So don't go looking for where it should go like I did :wink:

Shows that if "typical" runlevels are ever documented, that document will cost some maintenance effort too..
Back to top
View user's profile Send private message
sf_alpha
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2002
Posts: 136
Location: Bangkok, TH

PostPosted: Wed Aug 16, 2006 12:52 pm    Post subject: Reply with quote

You can config which runlevel (number) will run as which soft-runlevel (/etc/runlevels/). Look /etc/inittab :-)

I usualy create new 'maintenance' soft-runlevels with run as runlevel 3 (same as default) but run only 'sshd' and all of 'boot' runlevels
_________________
Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum