You are not logged in.

#1 2008-04-14 07:39:17

Nathan P
Member
Registered: 2008-01-30
Posts: 93

What exactly is a BSD style init framework?

I keep seeing this statement but what does it actually mean?  Looked it up on Wikipedia and it went right over my head...  How is Arch like/unlike BSD and most other Linux distros?  I have a friend who's hardcore into FreeBSD and he loves it because it's so organized, all user apps go to the same folder, system stuff to a certain folder, etc, instead of everything all mixed up with lots of places to put everything like most linux distros have.  Is this similar to how Arch works?

Thanks,
Nathan

Offline

#2 2008-04-14 11:46:32

ornitorrincos
Forum Fellow
From: Bilbao, spain
Registered: 2006-11-20
Posts: 198

Re: What exactly is a BSD style init framework?

As I see it(correct me if I'm wrong) all the init script for daemons are located in /etc/rc.d instead of /etc/init.d/rc.{0,1,2,3,etc...} and the basic system configuration(daemons to start, keyboard layout, ...) is located in /etc/rc.conf


-$: file /dev/zero
/dev/zero: symbolic link to '/dev/brain'

Offline

#3 2008-04-14 12:11:34

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: What exactly is a BSD style init framework?

The main difference is that Arch and BSD use a single file (/etc/rc.conf) to point to a single directory (etc/rc.d/) for all system services regardless of runlevels. There exist only 2 runlevels in a BSD style init; single and multi-user. (3 if you count X )
A sysvinit would use an entire directory for each runlevel /etc/rc.1,2,3,4,5 etc., with a convoluted array of symlinks within the directory; one for each service, and each symlink pointing to a corresponding script in the /etc/init.d/ directory.

Offline

#4 2008-04-14 16:39:43

Nathan P
Member
Registered: 2008-01-30
Posts: 93

Re: What exactly is a BSD style init framework?

Okay, so it basically simplifies how the basic daemons are started and run?

Offline

#5 2008-04-15 02:06:58

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: What exactly is a BSD style init framework?

Correct me if I'm wrong, but it's the other way around: BSD style is not meant to simplify, it was just the first way of doing things. Sys V was invented later, to fine-tune daemon management based on runlevel - being more complex while doing this.

Offline

#6 2008-04-15 02:31:21

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: What exactly is a BSD style init framework?

freakcode wrote:

Correct me if I'm wrong, but it's the other way around: BSD style is not meant to simplify, it was just the first way of doing things. Sys V was invented later, to fine-tune daemon management based on runlevel - being more complex while doing this.

Of course you are right, since BSD's history is 30 years in the making. tongue
Arch, CRUX and Slackware do it the BSD way. I am not sure if there are others. Debian and some of its derivatives do it the sysvinit way. I believe Ubuntu uses upstart, which I am not familiar with.

Offline

#7 2008-04-16 22:19:13

soloport
Member
Registered: 2005-03-01
Posts: 442

Re: What exactly is a BSD style init framework?

BSD:
* Startup scripts are generally kept in /etc/rc.d/
* A small number of files (/etc/rc.sysinit, /etc/rc.local, etc.) control the startup process

Sys V:
* Startup scripts are generally kept in /etc/init.d/
* There are also a number of /etc/rcX.d/ directories -- one for every run-level (i.e. X represents 0 through 6 and S, so, 8 altogether)
* The contents of each /etc/rcX.d/ directory is a collection of soft-links to scripts in /etc/init.d/
* Each soft-link in a specific /etc/rcX.d/ directory is named so it will execute in the order of it's alphabetical relationship to the other soft-links

Example (ls -1 /etc/rc3.d/):
S05vbesave  <-- execs first
S10acpid
S10sysklogd
S10xserver-xorg-input-wacom
S11klogd
S12dbus
S12hal
...
S98usplash
S99acpi-support
S99laptop-mode
S99rc.local
S99rmnologin  <-- execs last

This example was actually 39 lines long -- and just represents run-level #3.  In addition, /etc/rc.local executes after the target run-level is finished doing init.

So, given Sys V's complex hierarchy -- spanning 8 run-levels by an average of N-number of daemons -- you can probably guess why so many people rave about Arch's BSD-style init schema ;-)

Offline

#8 2008-07-04 00:28:33

ninjatux
Member
From: North Brunswick, NJ
Registered: 2008-07-03
Posts: 3

Re: What exactly is a BSD style init framework?

freakcode wrote:

Correct me if I'm wrong, but it's the other way around: BSD style is not meant to simplify, it was just the first way of doing things. Sys V was invented later, to fine-tune daemon management based on runlevel - being more complex while doing this.

SysV tried to improve a system that didn't need improving.  In BSD, there are only two runlevels, single-user mode and multi-user mode.  That's it, and it works very well.  That's not to say that the SysV init doesn't work well.  It does too, but SysV's aim was never simplicity.  However, fast-forward to today and you'll see that BSD is actually closer to Unix philosophy, which emphasizes simplicity.

Offline

#9 2010-05-24 19:10:44

martin77
Member
Registered: 2010-03-14
Posts: 111

Re: What exactly is a BSD style init framework?

Thanks to you all, I just finished reading this topic and find this info very enlightenment.
Best.

Offline

#10 2010-05-24 20:02:01

pseudonomous
Member
Registered: 2008-04-23
Posts: 349

Re: What exactly is a BSD style init framework?

soloport wrote:

BSD:
* Startup scripts are generally kept in /etc/rc.d/
* A small number of files (/etc/rc.sysinit, /etc/rc.local, etc.) control the startup process

Nitpicker's point:

The classic 4.4BSD and previous BSDs did not include /etc/rc.d/ startup scripts at all, and OpenBSD continues in this tradition, lacking an equivalent to the /etc/init.d/ scripts common on SysV-style systems, instead it has a single /etc/rc script whose behavior is controlled by the /etc/rc.conf file.  I don't know about how the other modern BSDs control starting and stopping services besides for the fact that they include /etc/rc.conf files, I assume, based off of soloport's post that most use /etc/rc.d/ scripts.

Last edited by pseudonomous (2010-05-24 20:02:32)

Offline

#11 2010-06-15 14:09:46

soloport
Member
Registered: 2005-03-01
Posts: 442

Re: What exactly is a BSD style init framework?

pseudonomous wrote:

Nitpicker's point:

Subject: What exactly is a BSD style init framework?

big_smile

Offline

Board footer

Powered by FluxBB