(Note that I’ve only ever done this on Cen­tOS 6.2. It should work in a lot of other places too though, espe­cially other RHEL based distros.)

I really wanted to use the Smokeping init script that comes with Ubuntu 10.04.* LTS  on a Cen­tOS 6.2 box. One look at it, how­ever, and you will very quickly realise that out-the-box that isn’t some­thing which is likely to work, pos­si­bly for other rea­sons, but def­i­nitely because you don’t have “start-stop-daemon” on a Cen­tOS box; not yet at least :)

This help­ful post sug­gested that if you pull the dpkg source from one of the Debian mir­rors then you could build it, albeit quite nas­tily, and end up with a suc­cess­ful build of start-stop-daemon. How­ever, it doesn’t have to build so nas­tily. Newer ver­sions of dpkg build cleanly, as I dis­cov­ered and have detailed below. As root or using sudo, do the following:

cd /usr/local/src
wget -c "http://za.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.15.8.4ubuntu3.tar.bz2"
tar jfxvh dpkg_1.15.8.4ubuntu3.tar.bz2
rm dpkg_1.15.8.4ubuntu3.tar.bz2
cd dpkg-1.15.8.4ubuntu2/
./configure --without-install-info --without-update-alternatives --without-dselect
make && make install

Now if you type “which start-stop-daemon” you should dis­cover that it’s built and installed into /usr/local/sbin, and works per­fectly just like it’s sup­posed to. And with that hur­dle out the way, I could now fin­ish get­ting that Ubuntu init script work­ing on Cen­tOS. Happy time :)