May 23, 2010
Last week’s techmail was Set up Dropbox on a GUI-less Linux server which takes you through the necessary steps of setting up Dropbox on a GUI-less Linux box. I use Dropbox here for keeping certain files in sync between systems, but I also am connected to a secondary Dropbox to act as a remote backup for a long-standing client of mine. It works great; they have two systems that share data (encrypted disk images), and I’ve also had to run a second copy of Dropbox on my system here to keep a copy of that data, but I was then rsyncing it to my remote backup server as well. With this, I can skip my system at home as being the “middle man” and get that remote backup server (headless CentOS 5) linked to the Dropbox instead. Saves bandwidth and headaches.
For anyone who uses runit, the following is a script to supervise dropboxd as a specific user. With runit I can connect to as many independent Dropbox accounts as I like, running each under a specific user.
#!/bin/execlineb
# $Id: run 849 2009-04-19 21:33:01Z vdanen $
/bin/fdmove -c 2 1
/bin/export PATH "/sbin:/bin:/usr/sbin:/usr/bin"
/bin/export HOME "/home/vdanen"
/bin/cd /home/vdanen/.dropbox-dist
/sbin/chpst -u vdanen /home/vdanen/.dropbox-dist/dropboxd
Read the tip for how to get it all setup.
April 7, 2010
I’m sure I’ve mentioned this before, but I maintain a repository of packages for Red Hat Enterprise Linux 5 (arguably these could/should be in EPEL but I’ve not had time to get into the Fedora side of things as of yet… someone will beat me with a wet noodle, no doubt). It’s a very small set of packages so I don’t feel too awful about it.
Anyways, one of my favourite features in Annvix was being able to run the entire system out of runit (Annvix used runit in place of SysVinit). This gave us nicely supervised services using runit (much like DJB’s daemontools). Feeling crappy with the first day of a head cold, I spent some time today over lunch to get runit working with RHEL5. I had to re-tool the package since I don’t want it to replace SysVinit, but run under init and just supervise services (like sshd, exim, etc. — call me weird, but runit/daemontools makes a fantastic watchdog and with sshd running from tcpsvd, I get some nice ACLs to use as well).
At any rate, runit now installs and works properly. Sorry to anyone who wanted to use it (I’ve been meaning to do this for the last year, ever since I switched all of my servers over to CentOS). The runit package also comes with a bunch of run scripts; I’ve not tested them all yet so if you do end up using it and have issues, let me know. I did have to fix a few minor things in a few of them.
At any rate, I’ve chkconfig’d off a few services and have them running supervised now:
# srv --list|grep -v '-'
service status pid started
crond up 2737 04/07/2010 02:16:32 PM
crond/log up 2735 04/07/2010 02:16:32 PM
exim up 2747 04/07/2010 02:16:32 PM
exim/log up 2746 04/07/2010 02:16:32 PM
mdadm up 2738 04/07/2010 02:16:32 PM
mdadm/log up 2736 04/07/2010 02:16:32 PM
ntpd up 2733 04/07/2010 02:16:32 PM
ntpd/log up 2731 04/07/2010 02:16:32 PM
smartd up 2739 04/07/2010 02:16:32 PM
smartd/log up 2734 04/07/2010 02:16:32 PM
sshd up 2732 04/07/2010 02:16:32 PM
sshd/log up 2730 04/07/2010 02:16:32 PM
One thing knocked off my TODO list. Replaced it with going to bed early tonight.
March 17, 2009
This week’s TechMail is How does Ubuntu’s Upstart system initialization compare with runit? which looks at the upstart system vs runit. I *really* like runit; so much in fact that with Annvix I rewrote the entire init system to take as much advantage of runit as possible and as a result ended up with extremely fast boot-times (of course, the rewrite helped and I was able to remove a bunch of stuff that I didn’t need). Anyways, this is a comparison and while upstart sounds promising for the future, I can honestly say that I would take runit over it (as it is now) anyday.
May 21, 2008
Last week’s Techmail is Log Linux services with runit (although I’m pretty sure that’s not the original title I submitted). Anyways, it discusses logging various services running under runit using svlogd, so you can completely separate services from each other. Syslog is cool, but too much stuff gets crammed in together. For most services, you can get both… for instance, running ssh under ipsvd, with svlogd logging you can see the connections received by ipsvd (so you can see connections, IPs, whether it was rejected or accepted, concurrency, etc.) and still have authentication show up in auth.log or whatever.