FreeBSD install package with prefix

Some packages supports a kind of customisation when compiling with FreeBSD. For example I want to keed track of version of dovecot installed on my system and install dovecot-2.2.10 on its own /usr/local/dovecot2 directory.

I have to run make config-recursive, to select which packages I want to install, and I have to run it as many times needed.

make config-recursive

Then I have to run:
make build-depends-list

/usr/ports/converters/libiconv
/usr/ports/databases/mysql55-client
/usr/ports/net/openldap24-client

install the packages needed as normal and finally install dovecot-2.2.10 in the place I want.

The only thing I have to do is to set the prefix. For example:
cd /usr/ports/mail/dovecot2
cat distinfo

SHA256 (dovecot-2.2.10.tar.gz) = 75592483d40dc4f76cc3b41af40caa4be80478946a699d4 6846d5d03e4d2e09b
SIZE (dovecot-2.2.10.tar.gz) = 4558660
make PREFIX=/usr/local/dovecot-2.2.10 install

If a newer version comes available I will do all the above procedure to check if a new package needed to be installed and then:
make PREFIX=/usr/local/dovecot-2.2.12 install

FreeBSD update ports

As referred here: https://www.freebsd.org/doc/handbook/ports-using.html

The Ports Collection is a set of Makefiles, patches, and description files stored in /usr/ports. This set of files is used to compile and install applications on FreeBSD. Before an application can be compiled using a port, the Ports Collection must first be installed. If it was not installed during the installation of FreeBSD, use one of the following methods to install it:

# portsnap fetch
# portsnap extract
# portsnap fetch update

So I think a
# portsnap fetch update
is enough for allready Ports Collection installed freebsd systems.

Managing network on FreeBSD

FreeBSD administration is a little bit different from linux. At the moment I had only experience as a hobbyist. Now I have to prepare my self for more enterprise experience on this Operating System.

That was an a little introduction about why I am going to post some freebsd relative articles.

Lets get into the issue of the article.

In order to restart network you have to run the following command:

service netif restart

This is not going to change routing tables produced before.
If you want to reproduce the routing tables you have to the following command:

service routing restart

And now if you want to do it in a simple command:

service netif restart && service routing restart

That was about services!

Now let’s see how you can manage interfaces.

the old time classic method to see the status of all interfaces:

ifconfig -a

to list the down network interfaces:

ifconfig -d

to list the up network interfaces:

ifconfig -u

to stop a network interface:

ifconfig network-interface down

to start a network interface:

ifconfig network-interface up

Now let’s see how to view the routing table:

netstat -rn

One of my future posts will be about disabling ipv6 networking.

freeBSD – make install clean accept default config or configure all at start

I am new to the freeBSD world. I am trying to figure out how to do things like install some packages. I was not familiar with ports at all. All my experience is around linux repositories.

So firstly, i tried to figure out how to find available packages to install, and thus I discovered whereis command:

whereis apache*

and the output is:

# whereis apache*
apache-forrest: /usr/ports/www/apache-forrest
apache-mode.el: /usr/ports/www/apache-mode.el
apache22: /usr/ports/www/apache22
apache22-event-mpm: /usr/ports/www/apache22-event-mpm
apache22-itk-mpm: /usr/ports/www/apache22-itk-mpm
apache22-peruser-mpm: /usr/ports/www/apache22-peruser-mpm
apache22-worker-mpm: /usr/ports/www/apache22-worker-mpm
apache24: /usr/ports/www/apache24

after choosing the package I want to install, I go to it’s port directory. For example to install apache2.4 I have to go to :

cd /usr/ports/www/apache24

and then I have to compile and install this package by executing:

make install clean

Now the problem sometimes is that most of the packages have configuration options in which, I have to manually choose the options. So if I install packageA with a lot of dependencies, those dependencies may have each a configuration option in which I have to make selections. There are a lot of interruptions, in the installing procedure. I need to be over the terminal and waiting for an interruption. This is time consuming and not productive at all.

So my first thought was to find a way to install packages with the default configuration options. I found this one:

make -DBATCH install clean

 

Then as a System Administrator, I thought that’s not my case, it’s a common usage case, but I need to know and configure some things. So I found how to make all the configurations needed recursively and then install the package:

make config-recursive
make install clean

You have to run make config-recursive as many times as needed to configure all dependencies. You have to do this, until all dependent ports options have been defined, and ports options dialog(1) screens no longer appear, to be certain all ports options have been configured as intended.

 

In order you want to reconfigure the package(s) you want to compile, then you have to run:

make rmconfig-recursive

I hope you find this post helpfull. As I go deeper with freeBSD, I like it more.

Source: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html

 

See how nfs client is connected to nfs server

Find out the configuration with which the nfs client is connected to the nfs server.

 

Bouncing my head to my keyboard while trying to find out where is the bottleneck on an nfs client-server relationship, I found out how to see the configuration with which the nfs client is connect to the server:

 

nfsstat -m

 

And the output is:

/nfsshare from nexenta.nfs-servers.example.com:/volumes/datastore/dataset/
 Flags: rw,relatime,vers=4,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.0.2.21,minorversion=0,local_lock=none,addr=10.0.2.245

 

Knowing exactly how the client is connected to the server, you can find more easily where the problem is.

 

Using the nfsstat -m command, you get the information about all nfs mounts. The -m switch is present on centOS, but abscent on FreeBSD, in which I do also performance tests.

 

You can also find all this information and also all the information about all mounts ( not only nfs mounts) if you execute:

 

cat /proc/mounts

 

I am trying to get this info on FreeBSD,  if everyone knows everything about this, please post a comment. I also asked a question at http://unix.stackexchange.com/questions/91594/nfs-mount-properties-options-in-freebsd to help me find the solution.