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.

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.