You are not logged in.

#1 2009-11-11 01:51:36

theturk
Member
Registered: 2009-11-11
Posts: 3

Init. Why BSD over SysV?

I am new to ArchLinux and just had a few questions on the choice of init.

Overall my question is simply, why?

What are the pros and cons of each system?

From the community standpoint why choose one over the other? Ease, Historic, Other?

From my perspective, SysV is a more dynamic and robust. I also find run levels as a major advantage. From what I understand BSD-init does at least have a single user mode, correct? However, I can easily see how creating dozens of symlinks can be daunting, but that can be solved with a simple script or application (ie service).

Offline

#2 2009-11-11 02:10:29

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Init. Why BSD over SysV?

Arch actually does use the same SysVInit package that other distros use. It just sets it up to behave like a BSD-style one. We still have runlevels, single-user mode, and a full inittab. All we don't have are the runlevel symlinks. Arch's rc.multi instead uses a list of scripts in an array in rc.conf to decide what rc.d scripts to start, and in what order. It runs the same ones for runlevels 2, 3, 4, and 5. Many people still use runlevel 5 to start a GUI login manager, or do other runlevel-dependent things, by setting them directly in inittab.

As far as why, I'd guess this goes back to the "simple" argument. Configuring one line in rc.conf is much more straightforward and robust than creating a bunch of 'S' and 'K' links, even if you have something like "chkconfig".

Offline

#3 2009-11-11 03:26:35

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Init. Why BSD over SysV?

ataraxia wrote:

As far as why, I'd guess this goes back to the "simple" argument. Configuring one line in rc.conf is much more straightforward and robust than creating a bunch of 'S' and 'K' links, even if you have something like "chkconfig".

QFT. I don't miss my SysV init days big_smile

It also comes down to saving on keystrokes when starting, stopping and restarting daemons... Typing '/etc/rc.d/sshd' is 2 characters less than '/etc/init.d/sshd' tongue

Last edited by fukawi2 (2009-11-11 03:27:39)

Offline

#4 2009-11-11 03:56:28

theturk
Member
Registered: 2009-11-11
Posts: 3

Re: Init. Why BSD over SysV?

Interesting, so do you know of a doc that recreates a typical distro feel? If not I would be interested in helpint write one. Maybe I could even use it for my technical writing course next semester; that'll be really boring for the rest of the class. tongue

Which file does init call first? rc.sysinit, I presume.

Offline

#5 2009-11-11 04:01:18

theturk
Member
Registered: 2009-11-11
Posts: 3

Re: Init. Why BSD over SysV?

nvm, /etc/inittab

Offline

#6 2009-11-11 16:06:50

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Init. Why BSD over SysV?

You can see the whole suite of Arch initscript infrastructure (not the individual service scripts, but the base scripts) at http://projects.archlinux.org/initscripts.git/ .

Offline

#7 2009-11-12 14:11:28

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

Re: Init. Why BSD over SysV?

theturk wrote:

Interesting, so do you know of a doc that recreates a typical distro feel? ..

Adding runlevels.

Offline

#8 2009-11-12 16:06:48

mcsaba77
Member
From: Ho Chi Minh City, Vietnam
Registered: 2009-09-30
Posts: 52

Re: Init. Why BSD over SysV?

I'd say simplicity. I started off with linux (RedHat 7.3) some years ago, switched to Mandrake a bit later. Then learning how linux works became a hobby (I don't have any formal or informal cs training, and my work is completely unrelated to linux). I downloaded lots of manuals, read man pages, and eventually... gave up.

Then a friend suggested FreeBSD. And amazingly (FreeBSD sounds geeky, doesn't it) I found it a lot simpler in many, many ways. None of the arcane command lines switches, command-line frontends upon frontends to the linux firewall for example - FreeBSD firewall configuration was dead easy. And so was everything else, including system-wide configuration in rc.conf, enabling daemons (that automatically do dependency checking, don't have to put them in any particular order).

To this day, a find the BSD init system simpler, and a lot more sane. All those symlinks, numbers, etc... with SysV init confuse me, I'm never sure what's really going on. I know, it's just a feeling, but FreeBSD and Arch seem a lot more transparent.

Now I've been using linux again for quite some time (since I bought my first laptop) - Kubuntu, than as it started degrading, Mandriva, SuSE, you name. Than found arch, and I felt right at home. So I guess you could say that in my case, familiarity is also a contributing factor (although the syntax is different).

Offline

#9 2009-11-12 16:11:19

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Init. Why BSD over SysV?

fukawi2 wrote:

[...] It also comes down to saving on keystrokes when starting, stopping and restarting daemons... Typing '/etc/rc.d/sshd' is 2 characters less than '/etc/init.d/sshd' tongue

function start() {
  until [ -z $1 ]; do
    if [ -f "/etc/rc.d/$1" ]; then
      sudo /etc/rc.d/$1 start
    elif [ -f "/etc/init.d/$1" ]; then
      sudo /etc/init.d/$1 start
    else
      echo "No such daemon:  $1"
    fi
    shift
  done  
}

function stop() {
  until [ -z $1 ]; do
    if [ -f "/etc/rc.d/$1" ]; then
      sudo /etc/rc.d/$1 stop
    elif [ -f "/etc/init.d/$1" ]; then
      sudo /etc/init.d/$1 stop
    else
      echo "No such daemon:  $1"
    fi
    shift
  done  
}

function restart() {
  until [ -z $1 ]; do
    if [ -f "/etc/rc.d/$1" ]; then
      sudo /etc/rc.d/$1 restart
    elif [ -f "/etc/init.d/$1" ]; then
      sudo /etc/init.d/$1 restart
    else
      echo "No such daemon:  $1"
    fi
    shift
  done  
}

Last edited by Wintervenom (2009-11-12 16:15:30)

Offline

#10 2009-11-12 19:29:54

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: Init. Why BSD over SysV?

Wintervenom wrote:

<code>

nice smile
now you just need a 'reload' one and some logic that detects if the script supports a reload argument or not, and if not does a restart


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#11 2009-11-13 12:27:12

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Init. Why BSD over SysV?

You can also grab upstart from aur, which actually is quite nice, specially if you use the new behaviour instead of just using it to wrap the existing rc.d scripts. (but that requires some work)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#12 2009-11-13 18:20:43

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Init. Why BSD over SysV?

Dieter@be wrote:
Wintervenom wrote:

<code>

nice smile
now you just need a 'reload' one and some logic that detects if the script supports a reload argument or not, and if not does a restart

function reload() {
  until [ -z $1 ]; do
    if [ -f "/etc/rc.d/$1" ]; then
      daemon="/etc/rc.d/$1"
    elif [ -f "/etc/init.d/$1" ]; then
      daemon="/etc/init.d/$1"
    else
      echo "No such daemon:  $1"
      exit 1
    fi
    grep -q 'reload)' $1 && $1 reload || $1 restart
    shift
  done  
}

Last edited by Wintervenom (2009-11-13 18:24:50)

Offline

#13 2009-11-13 18:46:02

rowdog
Member
From: East Texas
Registered: 2009-08-19
Posts: 118

Re: Init. Why BSD over SysV?

BSD style is good for humans; rc.local is easy to edit by hand. SysV is good for machines. It's much easier to write a program to manipulate a few symlinks rather than trying to parse and patch plain text.

I really like the Arch hybrid approach. We can use things like pacman but we can still add a locally installed daemon to rc.local instead of having to write a script and screw around with symlinks.

Offline

Board footer

Powered by FluxBB