Today I was idly performing some maintainence upon one of my hosts, and it crossed my mind to look beneath /etc in there I found:
That made me look more closely at the contents of /etc - the following command output was surprising:
steve@steve:~$ ls /etc | wc -l
Is that average? Heavy? Light? I have no idea, but I purged a hell of a lot of software today. Now I have only python v2.6 although for some reason I still have:
I suspect I could drop the pything2.6-minimal package, but for the moment I'm done. I have to make pretty people look exceptional with my magical camera.
Anyway as part of this cleanup I ran a quick sanity-check on which processes are running and I think, short of kernel processes, I'm as minimal as I can be. I understand the purpose and reason for every running service:
UID PID CMD
root 1 init 
pdnsd 14091 /usr/sbin/pdnsd --daemon -p /var/run/pdnsd.pid
root 14199 /usr/sbin/monit -c /etc/monit/monitrc -s /var/lib/monit/monit.state
root 14206 /usr/sbin/syslog-ng -p /var/run/syslog-ng.pid
root 14234 /usr/sbin/cron
102 14595 /usr/sbin/exim4 -bd -q30m
redis 14627 /usr/bin/redis-server /etc/redis/redis.conf
root 14637 /usr/sbin/sshd
These are basic services; I use monit to ensure those essential daemons keep running. The only oddity there is probably the local DNS cache, but it is useful if you run any kind of DNS blacklist-using service, for example.
root 14794 /sbin/getty -L ttyS0 9600 vt100
I need a serial console login for emergencies.
root 14796 runsv node-reverse-proxy
root 14797 /bin/sh ./run
root 14799 /opt/node/bin/node node-reverse-proxy.js --config ./rewrites.js
These three processes combine to run my reverse proxy which routes incoming HTTP requests to a number of local thttpd instances.
qpsmtpd 27309 /usr/bin/perl -Tw /usr/bin/qpsmtpd-prefork --port 25 --user qpsmtpd --pid-file /var/run/qpsmtpd/qpsmtpd.pid --detach
The perl SMTP daemon which runs my incoming mail, passing it to exim4 which listens upon 127.0.0.1:2525. You can read about my setup in the out-of-date writeup Chris & I put together.
/usr/bin/memcached -m 64 -p 11211 -u root -l 127.0.0.1
Memory cache for transient items.
s-blog thttpd -C /etc/thttpd/sites.enabled/blog.steve.org.uk
1030 thttpd -C /etc/thttpd/sites.enabled/edinburgh-portraits.com
s-hg thttpd -C /etc/thttpd/sites.enabled/hg.steve.org.uk
s-ipv4 thttpd -C /etc/thttpd/sites.enabled/ipv4.steve.org.uk
s-ipv6 thttpd -C /etc/thttpd/sites.enabled/ipv6.steve.org.uk
s-kvm thttpd -C /etc/thttpd/sites.enabled/kvm-hosting.org
One thttpd instance is launched for each distinct HTTP site my server runs. Each site runs under its own UID, with its own chrooted directory tree. This is important for security.
Each local instance listens upon 127.0.0.1 - and the reverse proxy previously mentioned rewrites connections to the appropriate one.
1016 28812 /usr/bin/perl -I./lib/ -I./ /usr/local/bin/blogspam
My anti-spam filter for blog comments.
Here is my christmas challenge. Can you identify each service upon your host? Do you know why you're running what you're running?
Me? I had no idea I had a dbus deamon running. Now I've purged it. Ha!
ObQuote - "I owe everything to George Bailey. Help him, dear Father." - It's a wonderful life.
Tags: random, sysadmin
14 May 2013 21:50
Today my main machine was down for about 8 hours. Oops.
That meant when I got home, after a long and dull train journey, I received a bunch of mails from various hosts each saying:
- Failed to fetch slaughter policies from rsync://www.steve.org.uk/slaughter
Slaughter is my sysadmin utility which pulls policies/recipies from a central location and applies them to the local host.
Slaughter has a bunch of different transports, which are the means by which policies and files are transferred from the remote "central host" to the local machine. Since git is supported I've now switched my policies to be fetched from the master github repository.
- All my servers need git installed. Which was already the case.
- I can run one less service on my main box.
- We now have a contest: Is my box more reliable than github?
In other news I've fettled with lumail a bit this week, but I'm basically doing nothing until I've pondered my way out of the hole I've dug myself into.
Like mutt lumail has the notion of "limiting" the display of things:
- Show all maildirs.
- Show all maildirs with new mail in them.
- Show all maildirs that match a pattern.
- Show all messages in the currently selected folder(s)
- More than one folder may be selected :)
- Shall all unread messages in the currently selected folder(s).
Unfortunately the latter has caused an annoying, and anticipated, failure case. If you open a folder and cause it to only show unread messages all looks good. Until you read a message. At which point it is no longer allowed to be displayed, so it disappears. Since you were reading a message the next one is opened instead. WHich then becomes marked as read, and no longer should be displayed, because we've said "show me new/unread-only messages please".
The net result is if you show only unread messages and make the mistake of reading one .. you quickly cycle through reading all of them, and are left with an empty display. As each message in turn is opened, read, and marked as non-new.
There are solutions, one of which I documented on the issue. But this has a bad side-effect that message navigation is suddenly complicated in ways that are annoying.
For the moment I'm mulling the problem over and I will only make trivial cleanup changes until I've got my head back in the game and a good solution that won't cause me more pain.
Tags: github, lumail, slaughter, sysadmin