Shallow Thoughts : : 17

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Fri, 17 Mar 2006

The Notch Gang

Our little squirrel family has grown to four. Notch has returned, after being gone for over a month, and now displays nipples like Nonotchka's. Turns out they were both females!

Notch is still as graceful, strong, and dominant as ever, and hangs around keeping Nonotchka from feeding. But we've found a solution: give Notch a nut in the shell, and she will take it off to bury it, which gives us a little time to sneak some nuts to Nonotchka before Notch flies back like a furry bolt of lightning.

Sometimes the ruse doesn't work. Once Dave went outside and chased Notch across the yard, over the fence and into the cedar while I communed with Nonotchka. Dave though he had her; but Notch vanished into the cedar branches, ran down the trunk and snuck under the gate while Dave was still watching the upper branches. Nonotchka only got a few nuts that time.

But that's not all. We have two other squirrels now, both apparently youngsters (they're scruffy, skinny, slightly smaller than our established squirrels, and markedly less graceful). One has white tufts between his ears, so I'm calling him Tuft; the other doesn't have a name yet and doesn't come by very often. They're both males, and yes, it is possible to tell when they're sitting up, contrary to some web pages I've seen.

Both of the kids are very nervous about us, and won't feed when we're anywhere in sight. But they're not nervous about Notch; the three of them sometimes eat at the same time, sitting on different parts of the fence, something Notch would never allow Nonotchka to do. Dave is convinced that they're Notch's kids from last year, and that he sees a family resemblance. The two kids sometimes quarrel mildly between themselves, and chatter at each other, but only when Notch isn't around; when she is, they're respectful and submissive.

Since the Notch Gang of three all tolerate each other, this makes it difficult to get any food to Nonotchka. She's taken to coming by later in the afternoons; the kids get up early in the morning, and Notch likes coming by around lunchtime.

Dave taped a little wooden shelf at the bottom of the office door where we can put nuts. Notch and Nonotchka learned it pretty quickly: not because they're any good at finding new nut sources (it takes them forever to notice a nut that's in a place where they don't normally find any; sometimes I wonder how the species survives) but because they're both bold enough to come to the door and look in when they're hungry, and eventually they bump their noses into the nuts on the shelf. Tuft is starting to notice the door-nuts, too, and will take one, then run off when he notices he's being watched.

I was able to get some photos of Nonotchka at the door (plus a few new shots of her outside in interesting poses). I tried to photograph Tuft today but he's too nervous.

Tags: , ,
[ 19:27 Mar 17, 2006    More nature/squirrels | permalink to this entry | comments ]

MySQL Losing its Socket!

This morning I was all ready to continue working on an ongoing web project when I discovered that mysql wasn't running.

That's funny, it was running fine yesterday! I tried /etc/init.d/mysql start, but it failed. The only error message was, "Please take a look at the syslog."

So I hied myself over to /var/log, to discover that mysql.log and mysql.err were both there, but empty.

Some poking around /etc/mysql/my.cnf revealed that logging is commented out by default, because: "# Be aware that this log type is a performance killer."

I uncommented logging and tried again, but /var/log/mysql.err remained blank, and all that was in mysql.log was three lines related basically giving its runtime arguments and the name of the socket file.

Back to the drawing board. I was well aware that I had changed the mysql settings yesterday. See, mysqld on Ubuntu likes to create its socket as /var/run/mysqld/mysqld.sock, but other apps, like Ruby, all expect to find it in /tmp/mysql.sock. It's easy enough to change Ruby's expectations. But then I found out that although the cmdline client mysql also expects the socket in /var/run/mysqld, it depends on something called mysqladmin that wants the socket in /tmp. (I may have those two reversed. No matter: the point is that you can't use the client to talk to the database because it and the program it depends on disagree about the name of the socket. This is probably a Dapper bug.)

Okay, so I had to pick one. I decided that /tmp/mysql.sock was easier to remember and more standard with non-Debian setups. I knew where to change it in the server (/etc/mysql/my.cnf is there and well commented) but the mysql client doesn't use that, and it took some googling and help from clueful friends to find out that what it wanted was a new file called /etc/my.cnf (how's that for a nice clear configuration file name?) containing one line:

socket          = /tmp/mysql.sock

That done, mysql started and ran and everything worked. Woo!

Except that it didn't the following morning after a reboot, and didn't give any error messages as to why.

Off I went on a merry chase across init files: /etc/init.d/mysql calls /etc/mysql/debian-start (which made me realize that debian has added yet another config file, debian.cnf, which has yet another copy of the line specifying the socket filename) which calls /usr/share/mysql/ as well as calling various other programs. But those were all red herrings: the trick to debugging the problem was to run mysqld directly (not via /etc/init.d/mysql start: it actually does print error messages, but they were being hidden by using the init.d script.

The real problem turned out to be that I had changed the location of the socket file, but not the pid file, in /etc/mysql/my.cnf, which was also located by default in /var/run/mysqld. Apparently that directory is created dynamically at each boot, and it isn't created unless it's needed for the socket file (whether the pid file needs it doesn't matter). So since I'd moved the socket file to /tmp, /var/run/mysqld wasn't created, mysqld couldn't create its pid file and it bailed. Solution: edit my.cnf to use /tmp for the pid file.

[ 13:29 Mar 17, 2006    More programming | permalink to this entry | comments ]