FreeBSD

On FreeBSD

..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

p5-XML-SAX-0.99 Install Error

Tuesday, May 8, 2012 

If you’re trying to install p5-XML-SAX-0.99 and get a

Can't locate XML/SAX/Exception.pm in @INC

error then you may need to

cd /usr/ports/textproc/p5-XML-SAX-Base
make distclean
make deinstall
make install clean

Then you can

cd /usr/ports/textproc/p5-XML-SAX
make distclean
make install clean

And you should get an error free install.  Apparently p5-XML-SAX-Base is a prereq that isn’t getting cleanly detected or updated in the make process for p5-XML-SAX.

Posted at 05:42:59 GMT-0700

Category: FreeBSDTechnology

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

PHP Startup: Unable to load memcache.so

Tuesday, September 13, 2011 

I noticed the warning
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/memcache.so' - /usr/local/lib/php/20090626/memcache.so: Undefined symbol "php_session_create_id" in Unknown on line 0

in my apache logs.  Googling for it, some sites suggested that old php.in files might  the cause.  But this is a pretty fresh install so I looked a little further and found a nerdstock note describing a similar problem.  I checked my /usr/local/etc/php/extensions.ini and finding that extension=session.so came after extension=memcache.so I moved it to the top of the file and the errors went away.

Posted at 00:29:25 GMT-0700

Category: FreeBSDTechnology

Rsync corrupted MAC on input

Saturday, August 27, 2011 

I am migrating my FreeNAS 7.x to a 8.x, which means copying the ZFS tank as there isn’t a tool for migrating the disks right now and upgrading them to the version of ZFS in 8.x. Kind of a pain in the butt that was made worse by the endless recurrence of an error like:

Received disconnect from xxx.xxx.xxx.xxx: 2: Packet corrupt
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (23734 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]

or something like:

Disconnecting: Packet corrupt
rsync: connection unexpectedly closed (581052724 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [receiver=3.0.8]
rsync: connection unexpectedly closed (202 bytes received so far) [generator]
rsync error: unexplained error (code 255) at io.c(601) [generator=3.0.8]

I figured my 7.x install had to be fine as I’ve been RSYNCing my server to it without error for about a year now, so the problem had to be in the new box and poking around for “packet corrupt rsync” on google was turning up a lot of *shrug* maybe bad RAM or a bad NIC. Hmmm… I tried command line push and pull from both boxes via SSH to see if I could get better results, no luck: a few files would transfer, maybe 10 seconds, maybe 5 minutes, then blop, bad packet, broken pipe, oh so informative “unexplained error” at io.c, start over. No way I was going to be able to transfer 3.5 TB 100MB at a time.

Finally I found this and checked the lovely graphical status monitor on the FreeNAS 7 box. It has 4GB of RAM, whichhas been plenty so far, but looking at the graph it was using about 95% of that memory. It had been up for 59 days so I was reluctant to reboot it, I mean uptime is a competition after all. But I took a dive and rebooted. Now, even with CIFS/SAMBA cranking some backup files simultaneously, RSYNC is running flawlessly at a nice steady 300mb/s, apparently limited by CPU (seems to be single threaded, maxing out one CPU and leaving the other idle, hmmm… problem for another day). I feel bad for doubting my FreeNAS 8 box, it was never the problem.

So if you’re getting RSYNC problems consider rebooting the server to free up RAM or even upgrading. The new box will have 12-16GB, which is about what is recommended for ZFS (1GB/TB) and things are looking pretty good. My RSYNC was running just -a –progress, no resource intensive -z option.

Posted at 00:24:53 GMT-0700

Category: FreeBSDTechnology

PHP default Lat Lon

Saturday, August 13, 2011 

Odd choice for the default lat/lon in php.ini
http://maps.google.com/maps?q=31.7667+35.2333+&hl=en&ll=31.766696,35.233305&spn=0.007799,0.007832&t=h&z=17

Posted at 02:14:29 GMT-0700

Category: FreeBSDTechnology

TLS 1.0 Hatin’ the Game

Wednesday, June 1, 2011 

After much reading and interpreting, it became clear there was no more advice for configuration variations to get client cert login working. It seemed Chrome was doing it right, IE not even trying, and Firefox failing. No advice as to why and setting LogLevel to debug didn’t add much in the way of useful hints.

TLS_bad.JPG

Jared Davenport, for reasons that would never have occurred to me, tried turning off TLS 1.0 in firefox as an allowed protocol. PCI compliance requires turning off a bunch of weaker/compromised protocols and ciphers anyway, so I already had:

SSLProtocol -ALL +SSLv3 +TLSv1

A quick test of

SSLProtocol -ALL +SSLv3

solved the problem with firefox. IE still refuses to talk to SSL, but IE is a stupidhead anyway. OK, it annoys me as the same client cert works on CACert.org’s site so something there is working right that isn’t on my box, but as I never use IE, I think I can let it go

no_tls_good.JPG
Posted at 01:21:25 GMT-0700

Category: FreeBSDLinux

Awesome SSL client cert fun

Tuesday, May 31, 2011 

Client cert authentication is oddly elusive given the practical value. I found a neat bug:

with
SSLVerifyClient optional
SSLVerifyDepth 3
SSLCADNRequestPath /usr/local/openssl/certs/clientcerts/

I get a request for identification in firefox, no problem. If I choose the right certificate to respond with I get an instant child pid 61501 exit signal Bus error (10). Every click on the “OK” button gets another seg fault. Yay. Magic.

client_cert.jpg

signal_bus_error.jpg
Posted at 00:36:09 GMT-0700

Category: FreeBSDTechnology

Stupidest Dialog Box Evar

Monday, May 2, 2011 

This is the dialog you get in thunderbird if you end up with multiple operations running – such as if you “download all mail” twice without realizing that a previous iteration is still running.

moz-screenshot-34.png

I could not possibly care that a background operation failed (and should be patiently and silently waiting until the other operation finishes, then try again itself; maybe, just maybe letting me know if I’m going to quit or shut down how many operations are pending in a single dialog).

But not only could no user ever care about the information provided by this dialog, it is done so as a modal dialog that steals focus. ZOMG, that’s the sort of user-hating bad design that makes people abandon a package.

Posted at 08:14:07 GMT-0700

Category: FreeBSDTechnology

Recursive, Incremental FTP

Thursday, April 14, 2011 

Looking for a way to transfer an entire website, including subdirectories, from one server to another directly, I found this summary https://stackoverflow.com/questions/113886/how-to-recursively-download-a-folder-via-ftp-on-linux of a great tool: NCFTP.

The client supports recursive “get” and “does the right thing.” It silently handles broken symbolic links, downloads all the files in the source directory including subdirectories, and even better, smartly does an incremental update on repeat saving a lot of time, bandwidth, and tedium.

Great utility that makes systems admin just a little bit easier. From now on, part of the default install.

https://www.ncftp.com/ncftp/

Posted at 16:00:39 GMT-0700

Category: FreeBSDTechnology