pavement

Runlevels

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(lieldelc)
(goddamn test vandalism is pissing me off)
Line 1: Line 1:
1
 
 
==What's different?==
 
==What's different?==
 
Linux runlevels define what services are available -- networking, GUI, etc. BSD runlevels define the system state -- what may be written or changed, kernel security, single user for fixing serious problems, etc. As such, BSD runlevels are used mostly for securing a server that's static (ie, once you've set everything up and nothing will need to be changed, you can bring the runlevel to 3 and no firewall rules or files will be changeable.) See man [[init]].
 
Linux runlevels define what services are available -- networking, GUI, etc. BSD runlevels define the system state -- what may be written or changed, kernel security, single user for fixing serious problems, etc. As such, BSD runlevels are used mostly for securing a server that's static (ie, once you've set everything up and nothing will need to be changed, you can bring the runlevel to 3 and no firewall rules or files will be changeable.) See man [[init]].

Revision as of 17:52, 22 December 2007

Contents

What's different?

Linux runlevels define what services are available -- networking, GUI, etc. BSD runlevels define the system state -- what may be written or changed, kernel security, single user for fixing serious problems, etc. As such, BSD runlevels are used mostly for securing a server that's static (ie, once you've set everything up and nothing will need to be changed, you can bring the runlevel to 3 and no firewall rules or files will be changeable.) See man init.

So how do I start stuff automagically?

Linux startup scripts usually live in /etc/init.d/rc.X/ where the X is the particular runlevel. BSD runlevels don't have this granularity for different services starting in different system states -- it's on or it's off, there's no dimmer switch. BSD startup scripts usually live in /etc/rc.d/ or /usr/local/etc/rc.d/ and they'll usually take the same form of commands as their linux siblings:

samizdata# /etc/rc.d/named start

on a BSD box will start up BIND DNS services, assuming the script is there and fully functional (which since it's the base system, it should be).

Certain services can be started automatically by placing certain entries in the /etc/rc.conf file -- do a man rc.conf if you want to see what you can put in there.

Editorial -- why I think the BSD and Linux runlevels are different.

Linux and BSD runlevels are vastly different, in part because of historical reasons (see SysV and BSD) and in part because of the very nature of BSD and Linux's origins. BSD started as a bunch of add-ons to AT&T Unix, so it had serious reasons to keep in line with Unix's SRV structures; Linux on the other hand, started as a way of getting a personal computer, a user or few users, a unix-like environment. Think of it as "business vs personal" use. So a lot of linux's differences from a more traditional unix were made from a pragmatic approach of "ok, how do we do this to make a sysadmin's life easier". BSD approached the same goal but with more of a focus on keeping the system running and stable.

So. No /etc/init.d/rc.d dirs because a BSD system's runlevels are there more for kernel and system security than for delineating what parts of the system are running. Linux runlevels say "in this runlevel, the network is up" or "in this runlevel, we're in single-user mode" or "in this runlevel, networking and X/GUI are running". BSD runlevels say "single user, emergency fix it mode" or "system tuning, don't play around".

See also

See Dru Lavigne's excellent article at O'Reilly Network's ONLAMP: http://www.onlamp.com/pub/a/bsd/2004/11/11/FreeBSD_Basics.html

Personal tools