FreeBSD

Memcached doesn’t compile with -O3

Friday, June 20, 2014 

Most of the ports in FreeBSD compile just fine with -O3, and why not use it?  Not like compile time is a real constraint and one of the features of FreeBSD is that it is actually optimized for the hardware it runs on, rather than being generic, opaque code.

But memcached don’t play that game.  The easy thing to do is modify /etc/make.conf on error, then fix it back after recompiling, but that gets tedious.  The following edit to /etc/make.conf automates the process:

.if empty(.CURDIR:M/usr/ports/databases/memcached*)
CFLAGS= -O3 -pipe -march=native -mtune=native
.endif

.if (.CURDIR:M/usr/ports/databases/memcached*)
CFLAGS= -O2 -pipe -march=native -mtune=native
.endif

Posted at 13:23:41 GMT-0700

Category: FreeBSD

openldap-server-2.4.33_2

Thursday, January 3, 2013 

With FreeBSD 9.1 out, it is time get all my ports upgraded in advance of doing the OS update.  The process is fairly painless, but occasionally, especially if you are slacking in the updates, a change in configuration causes the usually completely automatic “portupgrade -ra” to fail.

One such update was “Upgrading 'openldap-sasl-server-2.4.31' to 'openldap-server-2.4.33_2” which failed with a

===>  openldap-server-2.4.33_2 conflicts with installed package(s):
      openldap-sasl-client-2.4.33_1

      They install files into the same place.
      You may want to stop build with Ctrl + C.
===>  License OPENLDAP accepted by the user
===>  Found saved configuration for openldap-server-2.4.33

===>  openldap-server-2.4.33_2 conflicts with installed package(s):
      openldap-sasl-client-2.4.33_1

      They will not build together.
      Please remove them first with pkg_delete(1).
*** Error code 1

Stop in /usr/ports/net/openldap24-server.

But because this is FreeBSD and the open source community actually provides support, unlike, say Microsoft, where such an error would languish for months, if not years, with out a patch or any advice on how to fix it, the port maintainer, Xin Li, answered my question in less than 20 minutes with the following advice:

cd /usr/ports/net/openldap24-server
make config

Check “SASL” is checked?

Following his directions, everything compiled perfectly.

Posted at 15:49:42 GMT-0700

Category: FreeBSDHowTo

..Graphics/Tiff & GCC 4.6.4

Friday, June 29, 2012 

The latest (as of this writing) GCC port to FreeBSD 9.0 ended up creating some compile problems when I did a portupgrade -ra: /usr/ports/graphics/tiff couldn’t find some libraries:

g++46: error: /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/crtbeginS.o: No such file or directory
g++46: error: /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/4.6.3/crtendS.o: No such file or directory
*** Error code 1

The problem is that there is no more 4.6.3 directory once you install 4.6.4.  I didn’t bother debugging the port problem, though I probably should have and informed the port maintainer and all of those good citizenship steps but instead took a shortcut that solved the problem:

cd /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd9.0/
ln -s 4.6.4 4.6.3
cd /usr/ports/graphics/tiff
make clean
portupgrade -ra

And all is good.


  
Posted at 02:54:55 GMT-0700

Category: CodeFreeBSDTechnology

math/fftw3:

Sunday, September 25, 2011 

If you get a “Variable CFLAGS is recursive.” error when doing a portupgrade -ra on freeBSD, it appears the make file is broken. “break19” debugged it in this post.

at line 64 change #CFLAGS+= to #CFLAGS:=

his fix worked for me.

Posted at 23:58:57 GMT-0700

Category: FreeBSDTechnology

OpenSSL 1.0.0_4 Install Issues

Sunday, January 16, 2011 

Updating my server’s install of OpenSSL on FreeBSD 8.1 to 1.0.0_4 (openssl-1.0.0c) I ran into a problem where some of the patch files had been updated but the distinfo file in /usr/ports/security/openssl hasn’t (hadn’t?) been updated to match.

The symptoms are that the update of OpenSSL fails with two errors:

  • tls-extractor.patch line count is 1235, distinfo says 1234,
  • dtls-sctp-20.patch SHA256 hash is wrong,
  • (the tls-extractor.patch hash is wrong too, but the line count hits first).

- SHA256 (openssl-1.0.0c/tls-extractor.patch) = bb1aa486327fd96f9d6b870f0a1ad2c83dd4c06a96284eb64dde3f833ba5e0d0
- SIZE (openssl-1.0.0c/tls-extractor.patch) = 1234
- SHA256 (openssl-1.0.0c/dtls-sctp-20.patch) = 3b451618b64d7dbc917942759c26cbc717be3077e9d73cb3c5bd12a82a132268
+ SHA256 (openssl-1.0.0c/tls-extractor.patch) = b7dfb15b6ab7d62348eaa191fc8ba06565c92ecdd5d08bb5e9eb01a2e7433bb2
+ SIZE (openssl-1.0.0c/tls-extractor.patch) = 1235
+ SHA256 (openssl-1.0.0c/dtls-sctp-20.patch) = f002b13fead7c08270a9cfaf556be49c62be5b46f492ad59db29af4d3e9a4e67

Posted at 19:28:58 GMT-0700

Category: FreeBSDTechnology

Postie Image Resize Seems Broken

Tuesday, June 22, 2010 

I updated Postie for the first time in many years, and it seems my fix for ImageMagick is now obsolete, but another fix may be necessary.

It may be that Postie just doesn’t like the FreeBSD environment. The ImageMagick fix was mostly to point Postie’s hard-coded targets to BSD standard locations. This time through I haven’t found the right code yet as postie-functions.php has been completely rewritten.

Posted at 00:37:32 GMT-0700

Category: FreeBSDTechnology

Updating an IBM 335

Sunday, May 10, 2009 

I’m bringing up an old IBM 335 for use as a pfSense Firewall.  It is a fine computer, with almost everything you’d want except dual power supplies (the 336 has those plus 64 bit hardware).

IBM 335 Server

The first step is updating the machine:

  • BIOS to 1.16: download the flash image, it writes itself to a floppy, boot with that floppy and flash the BIOS.  I had to go through a bunch of 1990’s era software disks until I found a few floppies that would format without errors.  This also updates the LSI 1030 disk controller.
  • Internal Diagnostics to 1.07: these are disk images (.img) diskcopy didn’t seem to do the right thing on my XP box, so I used diskwriter 0.9 to create the disks.  You boot off the BIOS update disk then select update diagnostics.
  • Configure the disks with ServeRAID.   I didn’t flash the BIOS on the controller, but I did reformat the disks and set them up as RAID 1.
  • Update the System Management Processor to 1.06.  This is a self-booting floppy.
  • Update the Broadcom NetXtreme NICs to 209h.  This is a self-booting floppy that creates a RAM disk then runs the update.  The command for the 335 is UPDATE 8830

This gets the core hardware up to date.  You might also want to flash the firmware in the disks, though I did not as my box is loaded with unsupported disks.  Plus 36GB SCSI disks aren’t exactly going through a lot of teething pains these days.

Then I installed pfSense from the LiveCD (verify the hash).  This is pretty effortless.  The only important bit of data is to set up the NICs: in the 335 under FreeBSD bge0 is the lower port and bge1 is the upper port.

At a later date I will install a 73P9265 Remote Supervisor II adapater, but the cable I have (73P9312) is for newer boxes.  The 335 needs the 02R1661: oddly it is cheaper to buy the cable with a card than just the cable.  This will probably need flashing of the firmware, but is a nice tool with remote KVM and a lot of other slick features.

Posted at 23:09:31 GMT-0700

Category: FreeBSDTechnology

cannot connect to saslauthd

Tuesday, January 6, 2009 

I recently ran some updates on my FreeBSD server and ran into a problem that resulted in the following error in /var/log/maillog

warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory

The update process tends to kill saslauthd which will generally restart itself properly on reboot, but if you’re in the middle of a long rebuild and need to restore mail service quickly some or all of the following may help:

/etc/rc.d/inetd restart
/usr/local/libexec/courier-imap/imapd-ssl.rc stop
/usr/local/libexec/courier-imap/imapd-ssl.rc start
/usr/local/etc/rc.d/saslauthd stop
/usr/local/etc/rc.d/saslauthd start

Cyrus IMAP Logo

In the years since, I’ve moved to Dovecot.

Posted at 01:09:15 GMT-0700

Category: FreeBSD