You are not logged in.
Pages: 1
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
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
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
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'
Last edited by fukawi2 (2009-11-11 03:27:39)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
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.
Which file does init call first? rc.sysinit, I presume.
Offline
nvm, /etc/inittab
Offline
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
Interesting, so do you know of a doc that recreates a typical distro feel? ..
Offline
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
[...] 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'
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
<code>
nice
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
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
Wintervenom wrote:<code>
nice
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
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
Pages: 1