Archive for the 'FreeBSD' Category

Capistrano via Cron or FreeBSD Periodic

Tuesday, May 5th, 2009

Running Capistrano from cron or FreeBSD’s periodic can be tricky—both (wisely) limit your environment. Scripts may run just fine in a SSH session, but fail when run by cron.A couple of standard gotchas:

  • Command not found: your PATH is usually chopped down. Either explicitly set PATH to include you commands, or execute commands with their full paths.
  • No terminal. On Linux, try sudo’s -i option.

More puzzling:connection failed for: (RuntimeError: can’t get terminal parameters (Inappropriate ioctl for device))I assumed this was a tty/SSH/login session problem. Turns out it was a permissions problem. The current user couldn’t login to the remote server via SSH, and the remote server was prompting for a password. Of course, it worked when running this script by hand.

Dumb Thing I Did Recently With FreeBSD

Tuesday, October 30th, 2007

The point: if you have odd problems with your new computer, check for IRQ conflicts.

That’s been good advice for, what, twenty years? Anyway, I forgot it. Here’s what happened in case you’re as clueless as me.

I put together a new server for my “data center” — in the corner of the basement near the washer and the spare bicycle wheels. It’s spec’ed more or less from the Ars Technica mid-level system guide: Asus motherboard, AMD 64 CPU, SATA drives. I put FreeBSD on it.

Or, I tried to. Everything worked fine until I rsync’ed backup files from the old server, then boom! kernel panic and reboot. OK, I Googled about and learned that the ‘nfe’ network driver is recommended over the default ‘nve’ driver. Fair enough. That seemed to work better, though I still had many Ethernet transaction errors and watchdog timeouts. My connectivity was laggy and prone to drops.

My hub was 10BaseT only. I think I bought it right after I cancelled my Compuserve account. I replaced the hub with a nice Gigabit switch, and everything was great.

Well, better. It bugged me that my NIC only worked without the reccomended patch. I still saw an occasional warning in the log. And my SSH sessions dropped more than they should. I tried an old 100 MHz PCI NIC, and that worked, so I figured it was just bad hardware. I looked for something better than the onboard Intel NIC. Turns out, the onboard NIC is regarded as a good one, and when I tried another brand, it didn’t work at all.

At this point, I decided to live with the situation. That was OK until I installed Gnome so that I could run nightly Selenium tests. Boom. Panic every night when network backups started. I switched out the DSL router. I moved the server next to the router and replaced the 50-foot “data center” cable with a new short one. I removed all other computers from the wired network.

More panics. Hundreds of oversize frame errors n startup. Not just slightly above MTU size, but like 10,000. Huh?

At this point, I considered donating the motherboard and RAM to FreeGeek and just sucking it up and replacing all of it. I when through the messages log carefully and there it was: USB and NIC on the same IRQ.

My theory is that some Gnome-related daemons probe the USB ports, and this was interpreted as Ethernet traffic. I obvioulsy don’t really know crap about hardware though. In any case, I disabed USB in the BIOS and nary a problem now.