nedeľa 19. februára 2012

Ports install/deinstall and upgrade

As I mentioned before, there are two ways of "installing" ports.
One way is via "pkg_add" with "-r" parameter which fetches pre-compiled package from a public server. Check previous article. Without "-r" option, package is installed from hard drive, so you have to download package manually. Benefit of doing it this way is speed.
Second way is via compilation of source code. Search for package you want, go to relevant directory in ports tree and type "make install clean". This means shorten version to include three commands: "make"+"make install"+"make clean".
Every port can have additional parameters to be compiled with.
For example original port "cvsup" can be compiled with/without X11 support. To show additional parameters type:
make showconfig


To configure parameters type: "make config". Or to reset parameters and start again type: "make rmconfig".
To find more option look into "man ports". 

To upgrade installed ports, I use "portmaster". It's very efficient and quick tool to upgrade ports. You can check in handbook, there are many ways how to do that but I prefer this one.
Do "make install clean" in ".../ports/ports-mgmt/portmaster/". 
In manbook, there is a lot of options that are useful in case of automatized update or so. 
Basically I use two options: "-L" and "-a". 
First one shows installed ports and available updates if any and second updates all ports which have update available. 


Do deinstall ports, three basic options exists. 
1. Use "make deinstall clean" in relevant port directory.
2. Use "pkg_delete". "-r" for dependencies remove and "-n" for dry run so you can see what will happen if...
3. Install "pkg_cutleaves" and check man. This one is useful to safely remove ports with dependencies. Quite interactive.







streda 15. februára 2012

Syslog server/client

Syslog is elementary part of base system. It works like client and server at once. 
Every daemon, service, kernel, ... generates messages about its activities. These messages are stored in logs in "/var/log".
Messages can be basically divided according to daemon/service/host which generates these messages or importance (log level) of messages.
Syslog is running in background (ps aux | grep syslog or pgrep syslogd).
In client mode, syslog sends messages to host where's the syslog server running.
In server mode, syslog receives messages from hosts and stores messages in "/var/log". Note that meaning of "hosts" include also our computer (localhost), which is mainly only host from syslog receives messages.


You don't have to have "syslogd_enable="YES"" in "rc.conf" because it's running as default local service. What's more importnant is syslogd flags.
By default syslogd is running with flags "-ss -cc".
-ss - doesn't open socket(IP+port) at all (for more:man syslogd)
-cc - disables compression of repeated occurrences


So, with "-ss" or "-s" flag, syslog won't receive messages from remote hosts, only from localhost. Hence, if you want to receive those messages, change syslogd flags. Flags which I use:

syslogd_flags="-4 -b [IP] -C -cc"
-4 - runs on IPv4
-b [IP] - bind to specific IP otherwise *.*:514 (UDP)
-C - creates file-name of log if doesn't exist. (Security risk)
-cc - disable compression


You can add "-v" or "-v -v". This can be sometimes useful. Difference between both above: (from router in my LAN)
-without:
Feb 12 22:25:17 192.168.1.254 Set Device Time to:...
-v:
Feb 12 16:47:33 <1.5> 192.168.1.254 Set Device Time to:...
-v -v:
Feb 12 17:16:38 <user.notice> 192.168.1.254 Set Device Time to:...


Also, using "-d" for debug running of syslogd is very handy in troubleshooting etc. as you will see later. With this flag and "/etc/rc.d/syslogd restart", syslogd runs on foreground and it's possible to cancel it by Ctrl+C.


Config for syslogd is stored in "/etc/syslog.conf". Contains client and server options.
This is the original "syslog.conf": (commented lines removed)
*.err;kern.warning;auth.notice;mail.crit        OQ/dev/console
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages
security.*                                      /var/log/security
auth.info;authpriv.info                /var/log/auth.log
mail.info                                      /var/log/maillog
lpr.info                                         /var/log/lpd-errs
ftp.info                                        /var/log/xferlog
cron.*                                          /var/log/cron
*.=debug                                    /var/log/debug.log
*.emerg                                      *
!ppp
*.*                                               /var/log/ppp.log
!*


*.err - every process which generates erros and higher
kern.warning - warnings and higher, just for kernel messages
* (path) - messages are forwarded to all logged in users
*.=debug - only debug, not higher
authpriv.none - authpriv is not logged
You can adjust logging to your needs with explanation above. As you can see, there are files in path (auth.log etc.). If you want to log to file, create file first (chmod 600) and then restart syslogd.


The path can be associated with host. For instance, we would like to send "mail.info" to hostname/IP logger.server.com and another example to send mentioned to user named "logger".
mail.info                                     @logger.server.com
mail.info                                     logger
Use TAB instead of spaces to separate columns.


If you don't want to receive console messages, remove or adjust corresponding line with "console" as path (first line).


One problem occurred when I wanted to receive messages from another device (router). Messages router generated were writing to several files (messages and server.log-my own). I didn't want to log it twice, that's out of main idea. I wanted to log it strictly to one file. I started syslogd with "-d" option.
I added this to the beginning of the config (before console line):
+192.168.1.254                                 
*.*                                             /var/log/server.log


It's a host block contained from two lines. In first, you add host, in second you add file to log to.

This is what I saw:
[root@MCBSD|/var/log]>/etc/rc.d/syslogd restart
syslogd not running? (check /var/run/syslog.pid).
Starting syslogd.
listening on inet and/or inet6 socket
sending on inet and/or inet6 socket
off & running....
init
cfline("*.*           /var/log/server.log", f, "*", "+192.168.1.254")
cfline("*.err;kern.warning;auth.notice;mail.crit        OQ/dev/console", f, "*", "+192.168.1.254")
cfline("*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages", f, "*", "+192.168.1.254")
cfline("security.*       /var/log/security", f, "*", "+192.168.1.254")
...
...


As you can see, at the end of each log option, +IP is added. So what that means, those messages matching the log option will be written including those from +IP. This leads to spreading messages from IP (192.168.1.254) to each logfile. This is not the purpose.


Check another case. This time we are not gonna put +IP at the beginning of the config file, but to the end of file. What will be the result?Result will be the same! Check:
[root@MCBSD|/var/log]>/etc/rc.d/syslogd restart
syslogd not running? (check /var/run/syslog.pid).
Starting syslogd.
listening on inet and/or inet6 socket
sending on inet and/or inet6 socket
off & running....
init
cfline("*.*                                /var/log/server.log", f, "*", "*")
cfline("*.err;kern.warning;auth.notice;mail.crit        OQ/dev/console", f, "*", "*")
cfline("*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages", f, "*", "*")
cfline("security.*                             /var/log/security", f, "*", "*")
...
...


Yep, you can see asterisk instead of +IP (last asterisk in each line). In system, asterisk generally means "any". This is even worse. Imagine you have more devices which are sending logs to the same server. There will be in each log file on the server tangle of messages from different IPs. 

Only workaround I've found so far is, turn the above negative to positive but before one more hint. I wrote about this:
+192.168.1.254                                 
*.*                                             /var/log/server.log
This notation is not complete. In syslog we have program and host blocks. Each have to be closed. That one above is still open. This is the correct notation:
+192.168.1.254                                 

*.* 
+*


For program block use following:
![daemon]
*.*                                             /var/log/daemon_example.log
!*

So now, with all knowledge. There is the final config with respective debug output. Config:
+localhost                                     
#
*.err;kern.warning;auth.notice;mail.crit        OQ/dev/console
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages
security.*                                      /var/log/security
auth.info;authpriv.info                         /var/log/auth.log
mail.info                                       /var/log/maillog
lpr.info                                        /var/log/lpd-errs
ftp.info                                        /var/log/xferlog
cron.*                                          /var/log/cron
*.=debug                                        /var/log/debug.log
*.emerg                                         *
#
!ppp
*.*                                             /var/log/ppp.log
!*
+*
#
+192.168.1.254
*.*                                             /var/log/server.log
+*


Debug:
...
off & running....
init
cfline("*.err;kern.warning;auth.notice;mail.crit        OQ/dev/console", f, "*", "+localhost")
cfline("*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages", f, "*", "+localhost")
cfline("security.*             /var/log/security", f, "*", "+localhost")
cfline("auth.info;authpriv.info                      /var/log/auth.log", f, "*", "+localhost")
cfline("mail.info               /var/log/maillog", f, "*", "+localhost")
cfline("lpr.info                  /var/log/lpd-errs", f, "*", "+localhost")
cfline("ftp.info                   /var/log/xferlog", f, "*", "+localhost")
cfline("cron.*                      /var/log/cron", f, "*", "+localhost")
cfline("*.=debug         /var/log/debug.log", f, "*", "+localhost")
cfline("*.emerg                                  *", f, "*", "+localhost")
cfline("*.*                                      /var/log/ppp.log", f, "ppp", "+localhost")
cfline("*.*             /var/log/server.log", f, "*", "+192.168.1.254")
...
...

Instead of "localhost" you can use "@" as alias for hostname but I prefer more clear expression. Finally, you can see that all logs come to right file.

I noticed using "localhost" may cause syslog stop working. I've noticed that local machine sends logs as hostname. For example hostname of my computer is "MCBSD" so if I use "localhost" there are no messages from "localhost" at all, even we think "localhost" as local machine or name for IP of local machine. So be aware and rather use hostname of your computer.


In order to test syslog, check utility "logger" and man page.


Some final hints: 

-don't test syslog server to receive logs from itself (+localhost)
This can causes circular behavior.
-don't bind syslogd to IP obtained by DHCP during boot without SYNCDHCP in rc.conf for particular interface specially you have debug flag for syslog in rc.conf. Can overload system.
-make sure the UDP port 514 is permitted by firewall




nedeľa 12. februára 2012

Vim install and configuration

You may have noticed we are editing/viewing files more and more. For these purposes I use "vim" editor. 
After minimal install, you can try to type "vi" in CLI. You will see kind of light,skimmed version of real "vim". We can make our work much more efficient with real "vim".

cd /usr/ports/editors/vim-lite - I use light version
make install clean
rehash

Now you can try to run vim with "vim" command. Notice you still have "vi" and "vim" command. I used to use old "vi" command, so we need to associate "vi" command with "vim" editor. One way how to do that is via alias. Put this in ".tcshrc":
alias vi /usr/local/bin/vim
setenv EDITOR vim - not necessary but why not

Log out and log in back and "vi" command should run "vim" editor.

That's nice, we have "vim" but to utilize vim's features for which we've installed "vim", we need to create config file with some parameters.
cd - go to home dir.
vi .vimrc - if ".vimrc" doesn't exist, vim will create new file
Put these lines into it:
set nocompatible - to stop vim acting weird
set number - show numbered lines
syntax on - distinguish syntax (very useful)
set backspace=start,eol,indent - make backspace work normally
set ignorecase - no case sensitve search
set incsearch - search on fly
set hlsearch - highlighted search
hi linenr ctermfg=darkgrey - color of line numbers
hi search ctermfg=red ctermbg=yellow - color of searched items

Now, after saving ".vimrc" and restarting "vim", all above should work. Essential controls in "vim":
a - insert mode (you can start typing)
i - replace mode (you can start typing)
/[string] - search in text
:w - save file, but not quit
:wq - save file with quit
:q! - force quit

It takes a while to get used to use "vim" but it's worth.

sobota 11. februára 2012

Create and update ports tree

You don't have ports tree yet because of minimal install at the beginning. For downloading and updating ports tree you need port "cvsup". But how to install port without having ports tree?

pkg_add -r cvsup-without-gui
"-r" causes to fetch port from server. Note that ports from "pkg" utility are pre-build. They are already compiled.

After each installation use "rehash" command otherwise your system won't be aware of new commands arising from new installed ports/packages.
"-r" downloads from default server. In order to achieve reliability, lower delay, speed improvement, we can change the server to different. Put new variable to shell environment. Add following to etc. ".tcshrc":
setenv  PACKAGEROOT ftp://ftp2.sk.freebsd.org

Check man for cvsup. First time your ports tree is built, this process takes long. Additional update of tree takes much less. For creating and updating use:
cvsup -L 2 [path to ports-supfile]



At first, copy ports-supfile from "/usr/share/examples/cvsup/ports-supfile" to where you want. Afterwards do etc. chmod 600 for copied file. Than edit it:
(I think the only value you have to change is cvsup server)
*default host=cvsup.sk.FreeBSD.org

Now use mentioned cvsup command. It will build complete ports tree so be patient. To reduce this time plus make it more effective, you don't need some branches of ports tree like "astro", "games" ports, exotic language ports and so on. To refuse these do following before first use of cvsup command:
mkdir /var/db/sup - you can use appropriate chmod
cp /usr/share/examples/cvsup/refuse /var/db/sup + opt. chmod
Add following to "refuse" file: (this is what I have in there)
doc/bn_*
doc/da_*
doc/de_*
doc/el_*
doc/es_*
doc/fr_*
doc/hu_*
doc/id_*
doc/it_*
doc/ja_*
doc/mn_*
doc/nl_*
doc/no_*
doc/pl_*
doc/pt_*
doc/ro_*
doc/ru_*
doc/sr_*
doc/tr_*
doc/zh_*
ports/arabic
ports/astro
ports/biology
ports/finance
ports/chinese
ports/french
ports/german
ports/hebrew
ports/hungarian
ports/japanese
ports/korean
ports/polish
ports/portuguese
ports/russian
ports/ukrainian
ports/vietnamese

So many needless branches. This method (with refuse file) have one disadvantage. Commonly (without refuse file), after each update, you run "make index" command in "/usr/ports" directory to build indexed database used etc. for searching in tree hierarchy. This command takes long, but it works.
This command won't work if you use "refuse" file. The workaround is to fetch built index file. This is almost instant compared to "make index" but can have disadvantages with up to date issues. I have not noticed this theses issues so far...
To fetch built index file use following in "/usr/ports":
make fetchindex

After all procedure, you can try to "make" some port from ports tree. Very useful port is Midnight Commander similar to Norton(Total) Commander. I use light version.
Go to "/usr/ports" and type:
make search name=mc-light - useful command
(you can use also make search key=....)
This search command spits out information about particular port. Check the "path" and go there. 
Type "make install clean" in appropriate direcotry.
(In this example /usr/ports/misc/mc-light)

If you started from minimal install, you won't have installed anything. So etc. within "mc" making, other dependencies will install as well (libraries, fonts, prog. languages and so). It's often that dependencies have own dependencies so mainly first "installs" are annoying. You will be asked during building for building options. If you are not familiar with them, google them or use default one.
After mc-light have passed successfully, type:
rehash - see beginning of this article
mc - this starts Midnight Commander

For more information check handbook.









Post install settings 3

1.Locate
Basically, you have two ways how to search files through filesystem.
You can use command "find" or "locate".
Find: - this is live search as you know and scans. You can be 100% sure about results, because they are current.
Locate: - first you have to build a database of files stored in filesystem and then this command searches within this indexed database. So search results are instant but database don't have to be up to date, accordingly your results will not get entire results.
 
To update local database use:
/usr/libexec/locate.updatedb

Depends on amount of files, this process can take a lot of time.
You can run this script periodically via "cron" etc. after midnight (on server). 


Can happen, you don't need to index some filesystems, directories or so. Than look into /etc/locate.rc. This is config file for above script. You can configure for example:
SEARCHPATHS="/" - this causes to start indexing all files beyond "/" (root path).
PRUNEPATHS="/tmp" - this exclude paths from indexing
With above, you can make indexing more effective and faster.

I use "locate" very often to localize commands to check full path etc. It makes your work (scripting) easier because of speed. Be sure your database is up to date.


2. Set password
After minimal install, your root password is blank. It's better to use password for further purposes and basic security. (Generally all varies whether you use computer alone or it's shared or it's server.)
Very simple:
passwd - prompts you to type your new password
passwd [user] - same, but for another user

3. Connectivity
Your system don't have connectivity to network after base installation, even you have router on the end side with DHCP.
Basically, you can set network parameters statically or dynamically.
You need to know the name of your NIC. One way is to use "ifconfig" command to figure it out. 
For example I can see: ale0
"ale0" is mentioned name of NIC. To check little bit more use:
dmesg | grep ale0
result: ale0: <Atheros AR8121/AR8113/AR8114 PCIe Ethernet>
Don't forget to change interface to yours.

1.Static configuration
ifconfig ale0 inet [IP] netmask [mask]
ifconfig ale0 up
route add default [IP] 
(if you don't know what some parameter mean or you want to know more, check man ifconfig)
If you want preserve network parameters after system start, you have to edit "/etc/rc.conf" file:
ifconfig_ale0="inet [IP] netmask [mask]"
defaultrouter="[IP]"
Your DNS servers put into "/etc/resolv.conf"
etc.: nameserver [IP]

2.Dynamic configuration
dhclient ale0
To check assigned parameters do "ifconfig" + you can take a look into "/var/db/dhclient.leases.[interf]".
You can affect some parameters of dhcp via "/etc/dhclient.conf". Check the man for this config.
Put follows into rc.conf to preserve dhcp after next boot:
ifconfig_ale0="DHCP"
or ifconfig_ale0="SYNCDHCP" - booting will continue after dhcp assignment. 


After your interface is set, try to ping internal IP, public IP and public name (google.com).


For more informations check handbook / handbook.







štvrtok 9. februára 2012

Post install settings 2

We will continue in "tcsh" shell customization.

3. Customize shell prompt.:
You can achieve nice and pragmatic prompt really fast but what's perfect, you can use colors in your prompt. It's a little bit hard to understand, because of color syntax but you will be rewarded with fancy prompt. First take a look at b/w prompt and colored afterwards.

In "if" section of ".tcshrc" check the "set prompt" line.
The prompt is bordered with quotes.
You can put your "own words and symbols" to your prompt with combination of system variables like hostname, username, date, time and so. The list of variables can be found in "man tcsh".
The b/w prompt which I use:

set prompt = "[%n@%m|%~]>"
- [: my own character
- %n: prints username
- @: my own character to separate username and hostname
- %m: prints hostname
- |: (pipe character) my own character do separate directory from others
- %~: prints current directory (~will show instead home dir.)
- ]: my own character
- >: my own character
My prompt then looks like: 
[root@MCBSD|/etc]>

I use above prompt, but with colors. I use red for username letters, blue for [@|] and white for the rest. To understand color syntax, practice with it. Below example is for color of letters, you can set color even for background and so.

Color codes:
30m - black
31m - red
32m - green
36m - cyan
and so...for more check google: bash prompt color codes

Syntax:[starting string][your string][ending/reset string]

[starting string]: %{\033[36m%}
-just change "36m" to color you want. 36 is for cyan
[your string]: your symbol "etc. @" or variable "%n" for username"
[ending/reset string]: %{\033[0m%}
- leave this as it is, it resets color back to default


You have to use this syntax for every symbol in prompt in order to have colored this symbol.


Small example: word TEST with half cyan and half  red


%{\033[36m%}TE%{\033[0m%}{\033[31m%}ST{\033[0m%}
- %{\033[36m%} will make  "TE" to have cyan color 
- {\033[0m%} will reset color after "TE" back to default
- {\033[31m%} will make "ST" to have red color
- {\033[0m%} will reset color after "ST" back to default 


My prompt:
set prompt = "%{\033[36m%}[%{\033[0m%}%{\033[31m%}%n%{\033[0m%}%{\033[36m%}@%{\033[0m%}%m%{\033[36m%}|%{\033[0m%}%~%{\033[36m%}]%{\033[0m%}>"


If you compare letters marked with red, it's the same as in b/w prompt. Rest contains starting and ending strings.

That's it. Your life in CLI is more comfortable now. 
You have nice overview where and "who" you are by nice prompt.
You can use TAB key for better orientation in usable commands and for overview of listed files/folders in actual position.
You have shortcuts for faster executing your frequent commands.

 
 







Post install settings 1

Regarding previous post about minimal base install, the next handy steps are to adjust environment we will working through.
1.Change shell:
The default shell in FBSD is "sh". SH is shell with basic functions but nothing more. If you work in CLI often, it's better to use sophisticated shell. 
I use "tcsh" shell for CLI and "bash" for scripting. 
TCSH exists in base install but BASH not. If you want bash, you have install this via ports. (More about installing software in further time).

Changing shell is very simple:
For current user: chsh -s [shell]
Change shell for another user: chsh -s [shell] [username]
Etc. To change my current shell: chsh -s tcsh


Now you can log out and log in back to see the difference.
Before you have made a change, the sign of the shell was "#" what means you are in "sh" shell. Now you should see "%" in prompt line what means "tcsh" shell. 

Some ways to verify the current shell:
echo $SHELL
cat /etc/passwd (see end of line for particular user)
cat /etc/master.passwd (see end of line for particular user)


More about shells you can find in handbook

2.Customize shell prompt
As you can see, "%" at the beginning of the prompt doesn't seem nice and you can't list of possible commands by pressing TAB key.  Next handy trick is using aliases. Alias is CLI shortcut for whatever command.


Change your current directory to "home" (press cd).
By "ls - la" you should see file ".cshrc". Dot means something like hidden file. 
".cshrc" is configuration file for "csh" shell which is similar to "tcsh" shell.
Copy ".cshrc" to ".tcshrc" because we use "tcsh" shell.
Now you can edit ".tcshrc" for example with "vi" editor.
(Adjustment of vi editor in further time)
So what we are going to do:


1.Aliases etc.:
alias [shortcut] [command]
alias df /bin/df -h
alias cl /usr/bin/clear
alias re rehash
alias etc cd /etc
alias shut /sbin/shutdown -p now
and so.....what you want


2.Autolist:
In "if" section of the file (it should work placed anywhere) add:
set filec
set autolist


For apply the change, log out and log in back. Now press TAB key, and you should see suggestions. It works for commands suggestions and list of files suggestions. It's very helpful.


See the continue of this article.
 

nedeľa 5. februára 2012

Base install (minimal)

As I mentioned, I prefer minimal install and then adjust the system in way of my ideas.
Here you have a list of few installation steps. 
(FBSD 8.2-Release,64Bit).
(I suggest to install 64 bit version if you can, anyway everything is going towards 64bits)
1.Select country and eventually key-map after
2.Main menu
We are not installing Standard or Express install so choose "Custom" as we have everything under control.

3.Main menu
"Options" are not interesting at this moment. First we'll create a slice. More about disk geometry see etc. handbook. Everything regarding our BSD system will be stored in slice.

4. Partition - select disk
Select a disk you want to BSD install on. If you are not sure on which you have free space selected for your install there is a hint. In Windows etc. via Partition Magic or similar create random partition with space you want to spend on it. Etc. ext4(linux partition) with 60GB space. So this way your space for BSD will be marked and then you can browse disks (ad0/ad2 on the picture) and look for this partition. Then you can select that "marked" partition and delete it, so you are sure the new space created after is safely selected and you can't make a mistake by removing "live" filesystem. If you have hard drive dedicated for new BSD installation, then don't bother with that.
5. Partition - create slice
As you can see, there is a legend with letters assignment. See the unused space, select this row and press "C". The new slice is going to be created. Assign all possible space, so don't touch the number and press OK. That's it. 
 6. Create labels
See the step 3. Select the label. Then you will see picture below.
See the highlighted row. Every time you want to create "label" or mount point, go to this row first.
So you have highlighted the row and now press C. As description says, you can specify amount of space for particular mount point. If you don't know what the mount point is, check the google.
You can assign selected space to file-system or to swap. We are going to do both.
I prefer to create isolated mount points for root(/), /usr, /var, and /tmp. You can even create one mount point  associated with the root (/). Check the google if you don;t know how much space assign to particular mount points. It depends on purpose of your system. You will do nothing apocalyptic if you mounted all space to the root(/). Do not forget to reserve the space for SWAP partition. How much the size? Check the google. I have 6GB of RAM so its generally enough to live without SWAP, but for sure, I have 2GB of swap but I have not seen the SWAP in use on my system.
7. Select stuff to install
Check the step 3. Select the "Distributions". 
Here you can choice, what will be installed on your system. We prefer minimal install so choose minimal and then little bit more so select "Custom" on the same page and press OK.
Choice "Minimal" ends in self "base" and "kernels" selection. I have 64 bit system and i want to compatibility with i386 system so I've selected lib32 and for better orientation in commands we will need "man" pages. That's it. All further we are going to do or add manually - that's the purpose.
Select OK and you should appear in step 3.
8. Commit 
In step 3. select the media you want to istall from and again from step 3. menu select "Commit" and above dialogue will appear. "Yes" you want. Consequently the installation will start. 
At the end the following will appear:

 Select "No". Then select "Cancel" to end the installation.
Don't be scared, everything is installed and OK, remove CD eventually, select "YES" and system will be rebooted. Afterwards select default boot option and see the system booting. BSD will scan all the system to gather information about CPU, motherboard and connected devices. Than some self-checks and basic services will start. You should end in LOG IN prompt. 
That's it, you have fresh and powerful BSD install on your computer waiting to play with.

Why FreeBSD?

FreeBSD, in my opinion, is the best to start with from all BSDs.
It's well supported with ports (linux like packages), always up to date and increasingly supported by vendors.
FBSD little differs from Linux distributions in way of system administration.
I've tried many Linux distributions but FBSD fits me the best.
(Update: FBSD is UNIX-like system, not Linux-like or Linux distro)
I prefer to install minimal-base and adjust everything according to my ideas. The benefit of doing this, you are always familiar with your system, you don't have unnecessary balast arround and you will become professional by solving all snags on the way of adjustment your system.
FBSD is great as server OS or even Desktop. 
There is one "negative" about all of this: It often takes a long time to get your system adjusted and familiarized with so patient is appreciated and for those who has IT as hobby it won't be the problem, even vice versa.