View previous topic :: View next topic |
Author |
Message |
dcljr Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Southpark/avatar13.gif)
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Thu Jul 13, 2006 10:59 pm Post subject: Which init scripts go in which runlevels? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Zepp Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/808978641480190de6e9a1.jpg)
Joined: 15 Mar 2004 Posts: 1246 Location: Ontario, Canada
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dcljr Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Southpark/avatar13.gif)
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Thu Jul 13, 2006 11:36 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
dcljr Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Southpark/avatar13.gif)
Joined: 20 Aug 2005 Posts: 139 Location: Austin, TX
|
Posted: Thu Jul 13, 2006 11:44 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Zepp Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/808978641480190de6e9a1.jpg)
Joined: 15 Mar 2004 Posts: 1246 Location: Ontario, Canada
|
Posted: Fri Jul 14, 2006 6:48 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
rafo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 18 Nov 2003 Posts: 161 Location: Sollentuna, Sweden
|
Posted: Wed Aug 16, 2006 11:42 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
rafo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 18 Nov 2003 Posts: 161 Location: Sollentuna, Sweden
|
Posted: Wed Aug 16, 2006 11:57 am Post subject: |
|
|
I just learned that domainname has been dropped from Gentoo altogether. So don't go looking for where it should go like I did
Shows that if "typical" runlevels are ever documented, that document will cost some maintenance effort too.. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sf_alpha Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 19 Sep 2002 Posts: 136 Location: Bangkok, TH
|
Posted: Wed Aug 16, 2006 12:52 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|