Thursday, September 23, 2010

Damn Bollywood

I was recently reading the article Films considered the greatest ever on Wikipedia. Being a fan of Korean movies (of course I have watched only 4!), I got hold of the movie `Old Boy'. And in the midway of watching it, I realized that Bollywood has a remake in the name of Zinda.

Wikipedia `Zinda' entry says:

Most reviewers considered it to be a rip-off of the South Korean film Oldboy. Show East, the producers of Oldboy, initially expressed concerns but took no legal action as the studio had shut down.

Looks like these guys haven't paid for the rights, damn you. And you talk about piracy.

Monday, September 20, 2010

NetBSD drops down to single user mode after etcupdate?

The reason for this is carelessness. The comments in /etc/rc.conf clearly states:

# If this is not set to YES, the system will drop into single-user mode.

This is a common symptom of carelessness which can be attributed to the large number of questions asked by the etcupdate program. After carefully answering first few questions, I resorted to answering i to all the other questions.And etcupdate promptly replaced all my other configuration files including rc.conf and overwrote:

rc_configured=YES with rc_configured=NO

I paid for my carelessness by googling for next fifteen minutes, thank you.

Saturday, September 4, 2010

Dual booting *BSD with the new GRUB

With the new version of GRUB (1.98) there have been a lot of changes in the way things work. In the earlier versions of GRUB, the following entry was added to /boot/grub/menu.lst to boot into OpenBSD

title OpenBSD 3.0
root (hd0,0)
chainloader +1

The newer versions of Grub do not have the menu.lst anymore but are replaced by /boot/grub/grub.cfg.

Unlike menu.lst this file is never hand edited but gets auto-generated by the /usr/sbin/grub-mkconfig
using templates from /etc/grub.d and settings from /etc/default/grub.

To add entries for other operating systems, the entries are made in /etc/grub.d/40_custom file and grub-mkconfig is run, which generates /boot/grub/grub.cfg

One change that has to be noticed is the partition entry numbering start from 1. First partition in hd0 is (hd0, 1) which was (hd0, 0) in earlier versions.

To dual boot the *BSD systems, the following entries have to be added to /etc/grub.d/40_custom and run grub-mkconfig -o /boot/grub/grub.cfg, by default grub-mkconfig outputs to stdout.

menuentry "NetBSD 5.0.2" {
set root=(hd0,1)
parttool (hd0,1) boot+
chainloader +1

menuentry "FreeBSD 8.0" {
set root=(hd0,2)
parttool (hd0,2) boot+
chainloader +1

menuentry "OpenBSD 4.7" {
set root=(hd0,3)
parttool (hd0,3) boot+
chainloader +1

Thursday, June 10, 2010

Building and publishing a package on launchpad

This is a short how-to on creating packages for launchpad. Launchpad has more detail and in-depth documentation on almost all the required topics to create a package. I've compiled the topics into a short how-to for my convenience, read it here.

Wednesday, June 9, 2010

Installing and running UCARP on Solaris

I was surprised to see that there was not much documentation on how to install and run UCARP on a Solaris machine. I found a couple of blogs listing the startup and shutdown scripts but didn't mention about how to run UCARP itself. I am documenting about how to install and run it, for details on CARP and UCARP refer OpenBSD faq page and UCARP official website respectively.

UCARP has a dependency on libpcap, so you need to install the libpcap from here before trying to install ucarp itself. Else you will see errors like ucarp.h:63:18: pcap.h: No such file or directory while installing.

Use version 1.5.1 or earlier, 1.5.2 has linking issues and wouldn't compile. Once compiled and installed, running UCARP should be easy, all you have to do is create two simple scripts to bring up the interface and shutdown the interface.


ifconfig e1000g0:1 netmask
ifconfig e1000g0:1 up


ifconfig e1000g0:1 down unplumb

Make the scripts executable, also you can find more generic scripts here. The ip is the virtual ip address shared by both the machines. Once the scripts are setup run the below command on both the machines on which you want to setup UCARP.

Machine 1 whose ip is

/opt/ucarp1.5/sbin/ucarp --interface=e1000g0 --srcip= --vhid=42 \
--pass=word --preempt --neutral --addr= \
--upscript=/etc/ucarp/ --downscript=/etc/ucarp/ --shutdown &

Machine 2 whose ip is

/opt/ucarp1.5/sbin/ucarp --interface=e1000g0 --srcip= --vhid=42 \
--pass=word --preempt --neutral --addr= \
--upscript=/etc/ucarp/ --downscript=/etc/ucarp/ --shutdown &

This should be it. Note that the long options are somewhat necessary, since the shorter version of the options cause core dump.

Monday, June 7, 2010

Redistribution of files to new nodes on a Gluster file system

I happened to write a short HOWTO about redistribution of data on GlusterFS when new nodes are added to a existing distribute setup. The text version of the tutorial can be found here. The tutorial will appear somewhere in the official website after internal review.