July 18th, 2007
God is a new process monitoring Ruby framework with a rather apt name (no, it’s not that God). The config files looks something like that:
God.meddle do |god|
god.watch do |w|
...
end
end
Interesting code to write. And feels safe too to have God watching over your mongrels. Oh and you can use it to clean up stale mongrel PID files without patching mongrel_rails. Right now I use monit a lot and it’s really rather unDRY to have repeated configs for each mongrel on the server (is there a better way of doing this in monit?). God would be able to DRY it up.
July 16th, 2007
I’ve never actually explored log rotation tools in Linux and merely knew of the existence of logrotate and left it at that until log sizes really became a problem. Turns out logrotate is amazingly easy to configure, and thanks to this Logrotate and Mongrel blog post by Corey Donohoe I have it setup for my Rails applications that are running on Mongrel. Here’s what my /etc/logrotate.d/mongrel_cluster looks like:
/var/railsapps/APP_NAME/shared/log/production.log {
daily
rotate 28
missingok
compress
sharedscripts
postrotate
for i in `ls /var/railsapps/APP_NAME/shared/log/*.pid`; do
kill -USR2 `cat $i`
done
endscript
}
July 2nd, 2007
Not too long ago a couple of the Ubuntu Dapper Drake (6.06 LTS) VPSs we use abruptly became inaccessible. These VPSs were NIS clients that suddenly could no longer connect to the NIS master. Great. And as far as I could tell I didn’t do anything to those servers. I even managed to replicate the problem on another similar VPS (that was still accessble) simply by restarting the NIS daemon.
Thanks to Rimuhosting’s fantabulous support, I managed to regain access to the VPSs. Oh yeah, big lesson learnt here: when configuring NIS clients, be sure to leave at least one user account with sudo privileges or set the root account’s password (Ubuntu doesn’t come with a root account enabled by default - run sudo passwd to set it and enable the root account as a side effect). Big big lesson learnt. Don’t let this bite you in the ass if you’re a sysadmin-ish person.
Anyway, /var/log/syslog was complaining this:
ypbind[1026]: Unable to register (YPBINDPROG, YPBINDVERS, udp)
Which turned out to be a portmap problem. So yeah portmap wasn’t running! For a moment there I thought we had an easy solution. Sadly, /etc/init.d/portmap start was throwing this inexplicable error (i.e. Google wasn’t of much help):
root@zoidberg:/sbin# /etc/init.d/portmap restart
* Stopping portmap daemon...
...done.
* Starting portmap daemon...
dhclient.4.x 2.*.5, December 30th, 2000
Compiled on Dec 12 2003 09:55:54
Features: DBG, SEE, ALS, SEF
init: Couldn't open the file ./libuuid.so ->
...fail!
It sure isn’t caturday. After hours spent scrambling to find out why portmap can’t find libuuid.so, reinstalling the NIS .deb, comparing configuration files between working NIS clients and these busted ones, it finally dawned on me that I have yet to re-install portmap (not that it was logically sound that I’d have to reinstall it, but at this point I was willing to try anything). Annoyingly enough, it worked!
apt-get remove portmap nis
apt-get install nis
I still don’t know WTF happened there. If anyone has any clue please please point me to it.
June 26th, 2007
I had to spend some time setting up Xen on one of the new Dell servers we bought and while there was some documentation around, I had to constantly refer to the different sources since there wasn’t a complete page which had everything I needed for my particular situation - I have a host machine with Ubuntu Feisty Fawn installed and wanted to install a couple of Xen guest domains on it. One other thing I found lacking in the documentation is the explanation of commands or answers to the question “so why the hell am I doing this?”. I’m not considering LVM at the moment and am happy with loopback disk file images too.
So I think it’s a good idea to write this down somewhere for the next time I have to do the same bloody thing over again on any new servers.
Some caveats before we start:
- Like I said, I’m not gonna talk about LVM for disk images since I know next to nothing about configuring it at the moment. The host machine I have isn’t setup with LVM and I haven’t got the time to look into LVM either.
- I’m quite the networking newbie, so my setup uses the default Xen bridge installed via apt-get. Check out Xen networking on the Xen wiki for more complex network setups.
- I’m not gonna talk about putting a Linux distro other than that of the host machine into the Xen virtual machines. In other words, I have Feisty Fawn for both dom0 and all my domUs.
- I probably did some completely stupid things. Stuff like xen-tools exist to simplify Xen administration, but I haven’t had a chance to use them. Let me know if you spot an error or have a better way of doing something please!
Some terms that deserve explaining (most guides out there just use “DomU” and “Dom0″ without any ceremony, and assume you know what they mean):
- Domain-0 or Dom0: This refers to the host machine OS. You know, the OS of the actual physical server that you have.
- DomU: This refers to a Xen guest domain. A DomU is a single Xen virtual machine. The “U” stands for “unprivileged” I believe.
OK let’s go!
Read the rest of this entry »
June 13th, 2007
So there’s this big Leopard thing that’s the talk of Mac town (well, that and Safari) with all the new features being revealed (officially, at least, to the general public) at WWDC 2007.
Some of the features are pretty cool, most of them are mundane. For me, I am really looking forward to:
- the new Finder - Finder sucks so bad as a file system interface. I use Path Finder, which incidentally had an upgrade recently to 4.7. The new Finder looks pretty (Cover Flow for files, sexy!) but what I’m really hoping for is a Finder with which you can actually be productive.
- Ruby and Rails baked right into Mac OS X - while installing Rails and upgrading Ruby is a breeze on Mac OS X as it is right now, having these installed by default is pretty sweet. Even Capistrano will be included. Now, how one upgrades Ruby is another thing though…
- Time Machine - Even though I already own a licensed copy of SuperDuper!, I’m still eager to use Time Machine. I mean, who isn’t hooked on the time travel metaphor yet? It’s like System Restore done right (with the advantage of hindsight, of course).
What are you looking forward in Leopard?