Posts Tagged ‘ FreeBSD

ntpq timed out on freeBSD

I was running locally on a server and wanted to check in on ’s status. ntpq -p was not producing any output even though was running.

# ntpq -p
localhost: timed out, nothing received
***Request timed out

This is because I had the option “restrict default ignore” set in /etc/.conf. ntpq. This makes ntpd ignore EVERYTHING, even queries to the loopback interface. Ntpq queries ntpd over the loopback interface at 127.0.0.1. To allow these local queries, add:

 restrict 127.0.0.1

to /etc/ntp.conf, then also add restrict lines for your other upstream ntp servers.

restart ntpd:

/etc/rc.d/ntpd restart

Now ntpq -p will show you status of it’s peers

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 dns3.untangle.c .INIT.          16 u    -   64    0    0.000    0.000   0.000
 mirror          .INIT.          16 u    -   64    0    0.000    0.000   0.000
 153.16.4.133    .INIT.          16 u    -   64    0    0.000    0.000   0.000

Updating FreeBSD ports nicely using nice

Thanks to: http://scottspare.com/bsdfun/?p=75 for pointing me in the right direction. port updates can take a while and slow down your server. What you can do is use the ‘nice’ utility to force the processes to a lower priority. This will help your server to run almost normally during an .

When you use the ‘nice’ command inside of csh or tcsh, you need to mind that you give the full path to the binary so you dont use the built-in ‘nice’ command.

# /usr/bin/nice -n 10 {your update command}

What i use is:

# /usr/bin/nice -n 10  -aRrP

Man page for ‘nice’: http://www.freebsd.org/cgi/man.cgi?query=nice&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html

Freebsd-update fetch interupted

I lost power while - fetch was downloading patches up to 8.0-Release-p3. When the server came back online, I ran a -update fetch again and it still found two files that needed updating. after running -update install, got this error:

#  install
Installing updates...gunzip: (stdin): unexpected end of file
gunzip: (stdin): unexpected end of file
 done.

I guess a patch archive was corrupted. no problem though, just remove the download:

# rm -r /var/db/freebsd-update/files

now you can run

# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 8.0-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 2 files... done.

The following files will be updated as part of updating to 8.0-RELEASE-p3:
/boot/kernel/kernel.symbols
/boot/kernel/nfsclient.ko.symbols
# freebsd-update install
Installing updates... done.

no problems