# Things a Linux sysadmin should know



## mwtzzz (Sep 1, 2011)

Hi, I'm a primarily Redhat/CentOS Linux sysadmin. I recently started a new job with a company that makes exclusive use of FreeBSD. What are the main differences between FreeBSD and CentOS I should aware of in order to be effective at my job? Please limit the discussion to sysadmin-related things (I'm not interested in performance issues although that could be a different thread.)

Thank you.


----------



## DutchDaemon (Sep 1, 2011)

Sticky: http://forums.FreeBSD.org/showthread.php?t=9294


----------



## xibo (Sep 1, 2011)

* Your firewall and traffic shaper is likely going to be either of ipfw or pf, rather then iptables and tc
* Our NFSv4 implementation does actually work, which gives you something new to play around with
* You probably want to learn about ZFS
* Depending on what you need, you might have to modify the kernel config instead of just loading modules
* Third party programms (perl,snmp,apache...) usually work like in gnu, just that their config files go to /usr/local/etc instead of /etc by default

The handbook explains many of the common requirements.


----------



## jb_fvwm2 (Sep 1, 2011)

If you've not already done so, you may want to check the Howto subforum for threads which may make your tasks easier (There is a Building a Bsd Server book out also... maybe in its second edition. I bought the first edition when it first came out, but it is put away so cannot remember its title right exactly.)


----------



## ian-nai (Sep 2, 2011)

There's also a free (as in beer?) magazine.  http://bsdmag.org/


----------



## wblock@ (Sep 2, 2011)

There are little but important things like

don't change root's shell
don't set custom CFLAGS
sh is not bash
hier(7), mostly to see the importance of /usr/local/bin and /usr/local/etc
tuning(7)


----------



## Alt (Sep 2, 2011)

- sh/csh/tcsh/etc is not bash
- Do not compile software from vendor's tgz (with wget/make/make install)
- You can get problems if you mix ports and pkg_add
- Gerenally, shellscripts is not portable cus most linux'es symlinks most shells to bash
- All packages is installed with prefix /usr/local. httpd will never be placed in /etc/ or something like this
- Put your boot scripts to /usr/local/etc/rc.d/ in rc format, not into /etc/rc.d/
- cron and most things are old-style traditional tools; most tools that have extended functions are in POSIX mode
- shutdown -h will *halt* system, not power-off. shutdown -p will power off


----------



## anomie (Sep 2, 2011)

@mwtzzz: The differences are substantial. (I'm also a RHEL and FreeBSD sysadmin.) To the above points, I'd add that there is a distinct separation between the base system and "third party" applications (i.e. Ports). 

If you wish to be competent in your new gig, get yourself a test box and start installing, configuring, upgrading, breaking, and fixing FreeBSD.


----------



## anomie (Sep 2, 2011)

jb_fvwm2 said:
			
		

> There is a Building a Bsd Server book out also



That's a good book. I wrote a brief review back in the day. 

Speaking of good books, I still consider Absolute FreeBSD to be required reading. Pick it up at your local library, or buy used on amazon or half.


----------



## mwtzzz (Sep 3, 2011)

wblock said:
			
		

> don't change root's shell
> <... snip ...>
> sh is not bash



Neither of these is specific to FreeBSD.


----------



## mwtzzz (Sep 3, 2011)

Alt said:
			
		

> - sh/csh/tcsh/etc is not bash
> - Do not compile software from vendor's tgz (with wget/make/make install)
> - You can get problems if you mix ports and pkg_add
> - Gerenally, shellscripts is not portable cus most linux'es symlinks most shells to bash
> ...



Except for the first item - which is not at all FreeBSD specific - this is the type of advice I was looking for, thanks!


----------



## wblock@ (Sep 3, 2011)

mwtzzz said:
			
		

> Neither of these is specific to FreeBSD.



No, but they're common problems for Linux guys who switch.


----------



## anomie (Sep 3, 2011)

mwtzzz said:
			
		

> Neither of these is specific to FreeBSD.



Sho' they are. On most Linux systems, /bin/sh is symlinked to /bin/bash, and will attempt to be imitate the Bourne shell and be POSIX-ly correct when invoked as the former. Not so on FreeBSD. They're two totally different binaries. A _real_ Bourne shell is included with the base system, while shells/bash must be installed from Ports. 

As for the other one, a default FreeBSD install will give root a /bin/csh shell. The first thing many sysadmins (mistakenly) do is give him a shell they've installed from ports. That leads to major problems later - as a forum search can attest to.


----------



## NewGuy (Sep 3, 2011)

*Shells and ports*

The shells thing caught me by surprise when I first tried FreeBSD. So, yeah, while it's not specific to FreeBSD, it's a good thing to keep in mind.

The two big things though which stood out for me are the Ports system. Installing and maintaining software on a FreeBSD box is very different from a CentOS box. The other thing is the separation of third party software from the base OS. On Linux everything is thrown together. FreeBSD puts third party software under /usr/local. Takes a little getting use to, but it's a cleaner approach.


----------



## aragon (Sep 3, 2011)

Many linuxes have wget installed as part of their "base".  In FreeBSD we have fetch(1), and wget is in ports: ftp/wget.

Many linuxes have nano as their default editor.  FreeBSD has vi(1) and ee(1).  Again, go to ports for nano and many other editors.

In FreeBSD, more(1) and less(1) behave (almost) identically.

Many other small differences you'll learn as you go.  Welcome.


----------



## andyzammy (Sep 5, 2011)

Alt said:
			
		

> - Do not compile software from vendor's tgz (with wget/make/make install)



Why shouldn't you do this? Just curious, never tried it before but not sure why I shouldn't.


----------



## graudeejs (Sep 5, 2011)

andyzammy said:
			
		

> Why shouldn't you do this? Just curious, never tried it before but not sure why I shouldn't.



Because it needs to be patched. Otherwise IF it will compile fine, it will install files in linux specific directories, and then one day you will wonder, wtf, is /etc/someshit.conf ?
(note it's not limited to conf files, binaries can easily be installed in /bin/ or /usr/bin/)

Also removing such a software can be pretty hard (without proper preparation).
Finally it might overwrite something etc, etc etc... Shit can happen


----------



## UNIXgod (Sep 5, 2011)

mwtzzz said:
			
		

> Except for the first item - which is not at all FreeBSD specific - this is the type of advice I was looking for, thanks!



Historically csh is the BSD shell. So you actually are wrong in your assumption that it is not specific to FreeBSD.


----------



## mwtzzz (Sep 6, 2011)

UNIXgod said:
			
		

> Historically csh is the BSD shell. So you actually are wrong in your assumption that it is not specific to FreeBSD.



You misunderstood. I'm saying that the statement "sh/csh/tcsh/etc is not bash" applies equally to all Unix/Linux distrubutions, not specifically to FreeBSD.


----------



## wblock@ (Sep 6, 2011)

The confusion was due to vagueness in my post, so let me correct it:

FreeBSD's /bin/sh really is sh (a variant of the Almquist shell).  This differs from many Linii where /bin/sh is actually bash.

Found an interesting page on many operating systems and their shells: http://www.in-ulm.de/~mascheck/various/shells/


----------



## UNIXgod (Sep 6, 2011)

mwtzzz said:
			
		

> You misunderstood. I'm saying that the statement "sh/csh/tcsh/etc is not bash" applies equally to all Unix/Linux distrubutions, not specifically to FreeBSD.



The first Berkeley Software Distribution (i.e. BSD UNIX) was created by Bill Joy at Berkeley University in 1977. One could state that Joy was the first systems administrator as he installed patches received from Bell Labs and sent patches back to be incorporated into AT&T UNIX. He included the c shell (as well as ex and vi); the bourne shell was created a year later by Stephen Bourne. Also FreeBSD is not a distribution as it began years ago. It's a complete operating system. I assume your not working with other BSD admins. This is important info which is is FreeBSD specific in contrast to a GNU world wrapped around the linus kernel.


----------

