Page 1 of 1

SysV vs BSD init

PostPosted: Mon Feb 17, 2003 3:29 am
by Calum
does anybody happen to have a good link to a document that explains fully the two different (and perhaps any other that exist) init styles?

i am not too hot on how it all works and i'd like to read up on it, but google seems to throw up a lot of unrelated stuff when i do a search (mainly because a lof of unrelated tutorials tend to mention one or the other in passing i think).

thanks.

PostPosted: Mon Feb 17, 2003 9:38 am
by Void Main
This Section in the Red Hat 8.0 documentation gives a decent overview of the SysV style (6-8 pages). Here is one that is a little more concise from Red Hat 5.0, again heavy on the SysV side.

Here are some instructions for BSD style init on Linux. This guy seems to prefer the BSD style. Having used both styles extensively myself I have to say that I *MUCH* prefer SysV init. I thought SysV init was a little tougher to grasp but once you get it, it's stupid simple.


Of course you might look at the BSD man page for "init" as well as a SysV version.

PostPosted: Mon Feb 17, 2003 10:22 am
by Calum
thanks void main! that'll keep me going for a while! for some reason i can't get to the RH8 page, it comes up high in google when i search on this subject, but it's not loading for me right now. also, saw the LFS page earlier on, it looks good.

the RH5 page looks like it might give me the idea of 'shape' that i'm looking for. a lot of the time, i try and find some idea of the 'shape' of a new concept before i am capable of imbibing any info about it. it's often a little difficult to find the right shape giving webpages, but once i have it, i'm often away with it!

thanks again, void.

edit: just for other people's benefit, i'll post these two links i found, i think they look like good reading (and i'm about to read them!)

BSD Linux

Serious history of UNIX

PostPosted: Mon Sep 19, 2005 5:01 pm
by Master of Reality
let me get this straight then, most (or all?) linii use the sysV. Is there different versions of the init, like theres a bit of a difference between, slackware's and SuSEs init?

PostPosted: Mon Sep 19, 2005 5:28 pm
by Void Main
I've used a lot of distros and the only one that I have used that used the BSD style by default was Slackware as far as I can recall. I recall that you had the option of converting your Slack installation to SysV though. I don't know what they do by default now. If they have directories named /etc/init.d, /etc/rc2.d, /etc/rc3.d, /etc/rc4.d, ... with scripts in them and their names start with Knn* (kill scripts) and Snn* (start scripts) then it's running the SysV style init.

PostPosted: Mon Sep 19, 2005 5:34 pm
by Master of Reality
well they have /etc/rc.d/rc.* where rc.* is the startup scripts for various daemons. and there is rc.M rc.S, &c which tell which daemons to run and only if their script is executable. I find it very easy to use and such.

I find SuSEs files are in weird places under /etc and are specifically meant not to be edited by hand, which i try to do anyhow.

PostPosted: Mon Sep 19, 2005 6:23 pm
by Void Main
Master of Reality wrote:well they have /etc/rc.d/rc.* where rc.* is the startup scripts for various daemons. and there is rc.M rc.S, &c which tell which daemons to run and only if their script is executable. I find it very easy to use and such.


Yes, that is BSD style and not SysV. I must say that I used BSD style init when I first got in to UNIX (AIX) and also on the early Linux distros (SLS/Slackware) and when I first started using systems with SysV init I didn't like it. After a little investment in understanding of how SysV init worked I decided I liked it much better and would never want to go back to using BSD syle init. Of course that was well over 10 years ago when I made the switch. :)

PostPosted: Sat Oct 15, 2005 5:58 am
by Calum
well, looked at a different way, there's no actual difference between sysv and bsd style init setups, except for the "shape" of the files and directories. one file starts the whole thing off, and then refers to other files, they then refer to each other in whatever order they choose until the system is up under whatever runlevel.

in my opinion a bsd style init is fine, but a sysv init has arranged itself a little more modularly. it seems to me like bsd style init has a unix config file oriented outlook (where files get changed internally) while sysv style init would rather have things be easily removable and addable without needing to change (m)any rc files. Sysv has a more clever (but possibly not more effective) way of dealing with what order things get started in too. doesn't it go by the digits in the filenames to get the order to start things? whereas bsd style init would just go from the top of a config file and work down to the bottom, so the difference to change the order of execution would be either just changing the filenames in a sysv init environment, compared with shifting all the lines up and down inside a file in a bsd style init environment.

You could of course have both, slack does have some files or directories i think which are there to provide the requisites for an application that expects a sysv style init on the system, and aims to give such an application the behaviour it expects. With modern systems like fedora i expect you'd mess up a lot if you tried to convert to a bsd style init setup, but maybe it would be fun to try.

As usual, feel free to correct me anybody, these are only my own observations.

PostPosted: Sat Oct 15, 2005 9:13 am
by Void Main
I think you have it down. You obviously "could" run the BSD style init on Fedora (or any Linux system for that matter) but it would be more work. All (most) RPM packages built for Fedora (or any other SysV style distro) that are intended to be run as a service will include a SysV style startup script that is placed in the /etc/init.d/ directory. When the RPM is installed they usually run a scriptlet to execute "chkconfig" command to register the "service" and enable it. It will be set to start with the priority and runlevels stated by the "chkconfig" section of the comment field at the top of the init.d script.

There is nothing preventing you from configuring your BSD style init scripts to also look through the SysV directories (/etc/rc?.d) and start/stop services after the BSD scripts have run. I guess you would then have a hybrid. It's a little like using apt vs yum for package management. "yum" is the official dependency resolver/package manager for Fedora yet the first thing I do is remove this and install apt on all my Fedora systems. Of course that wouldn't create quite as many difficulties as switching out init.

PostPosted: Sat Oct 15, 2005 8:36 pm
by Master of Reality
Now that ive been using SuSE more on my laptop ive become a bit accustomed to the SysV init style. And i couldnt think of a way to use BSD init style to start services in parallel without getting fairly messy. SuSE 10 comes with parallel starting of services by default.
It still takes at least a minute to startup because of all the oops im still starting up (hotplug, wireless, etc). Whereas my thin slack install takes under 30 seconds because i dont use wireless, usb, hardware detection daemons, &c.

PostPosted: Sun Oct 16, 2005 3:34 pm
by Void Main
The first thing I do on any system right after install is turn all the services off that I don't use.

PostPosted: Mon Oct 17, 2005 5:57 am
by Master of Reality
yea well SuSE has a bit more services to make it userfriendly... hardware monitoring daemons and some services that monitor it to tell you when hard drives, printers, &c. are hotplugged and such

PostPosted: Mon Oct 17, 2005 7:54 am
by Void Main
Sounds like haldaemon. Fedora also has this. Here's the list on my laptop most of which are enabled at install time:

Code: Select all
$ /sbin/chkconfig --list
NetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off
NetworkManagerDispatcher        0:off   1:off   2:off   3:off   4:off   5:off  6:off
acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off
anacron         0:off   1:off   2:on    3:on    4:on    5:on    6:off
apmd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
autofs          0:off   1:off   2:off   3:on    4:on    5:on    6:off
bluetooth       0:off   1:off   2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
cups            0:off   1:off   2:on    3:on    4:on    5:on    6:off
cups-config-daemon      0:off   1:off   2:off   3:on    4:on    5:on    6:off
dc_client       0:off   1:off   2:off   3:off   4:off   5:off   6:off
dc_server       0:off   1:off   2:off   3:off   4:off   5:off   6:off
diskdump        0:off   1:off   2:off   3:off   4:off   5:off   6:off
gpm             0:off   1:off   2:on    3:on    4:on    5:on    6:off
haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
irda            0:off   1:off   2:off   3:off   4:off   5:off   6:off
irqbalance      0:off   1:off   2:on    3:on    4:on    5:on    6:off
isdn            0:off   1:off   2:off   3:off   4:off   5:off   6:off
kudzu           0:off   1:off   2:off   3:off   4:off   5:off   6:off
lircd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
lm_sensors      0:off   1:off   2:on    3:on    4:on    5:on    6:off
mDNSResponder   0:off   1:off   2:off   3:off   4:off   5:off   6:off
mdmonitor       0:off   1:off   2:off   3:off   4:off   5:off   6:off
mdmpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
messagebus      0:off   1:off   2:off   3:on    4:on    5:on    6:off
microcode_ctl   0:off   1:off   2:off   3:off   4:off   5:off   6:off
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
named           0:off   1:off   2:off   3:off   4:off   5:off   6:off
netdump         0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
netplugd        0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
nfs             0:off   1:off   2:off   3:off   4:off   5:off   6:off
nfslock         0:off   1:off   2:off   3:off   4:off   5:off   6:off
nifd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
nscd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
ntpd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
openvpn         0:off   1:off   2:off   3:off   4:off   5:off   6:off
pcmcia          0:off   1:off   2:on    3:on    4:on    5:on    6:off
portmap         0:off   1:off   2:off   3:off   4:off   5:off   6:off
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
readahead       0:off   1:off   2:off   3:off   4:off   5:on    6:off
readahead_early 0:off   1:off   2:off   3:off   4:off   5:on    6:off
rpcgssd         0:off   1:off   2:off   3:off   4:off   5:off   6:off
rpcidmapd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
rpcsvcgssd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off
smartd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
smb             0:off   1:off   2:off   3:off   4:off   5:off   6:off
snmpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
snmptrapd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
spamassassin    0:off   1:off   2:off   3:off   4:off   5:off   6:off
squid           0:off   1:off   2:off   3:off   4:off   5:off   6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
syslog          0:off   1:off   2:on    3:on    4:on    5:on    6:off
sysstat         0:off   1:on    2:on    3:on    4:on    5:on    6:off
tux             0:off   1:off   2:off   3:off   4:off   5:off   6:off
vmware          0:off   1:off   2:off   3:off   4:off   5:off   6:off
vncserver       0:off   1:off   2:off   3:off   4:off   5:off   6:off
vsftpd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
webmin          0:off   1:off   2:off   3:off   4:off   5:off   6:off
winbind         0:off   1:off   2:off   3:off   4:off   5:off   6:off
wine            0:off   1:off   2:on    3:on    4:on    5:on    6:off
xend            0:off   1:off   2:on    3:on    4:on    5:on    6:off
xendomains      0:off   1:off   2:on    3:on    4:on    5:on    6:off
xfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off
xinetd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
ypbind          0:off   1:off   2:off   3:off   4:off   5:off   6:off
yum             0:off   1:off   2:off   3:off   4:off   5:off   6:off