Nov 07

Thoughts on systemd

So the other day, I had to figure out if udev is still supported without using systemd, since the source trees have been merged, and we’re using Ubuntu at work which doesn’t use systemd. (answer: yes)  This research brought me to this systemd comparison page, detailing the differences between sytemd, Upstart, and SysV.  Not knowing much about init systems(besides Upstart and a little bit of SysV), systemd seems to have a lot of features in it – but as I’m reading these features, I’m wondering: should an init system do all of these things?

There seem to be a lot of things which aren’t particularly useful.  But perhaps they are(as I said, I’m not an expert on init systems).  They seem to be creating a particularly complicated system, and it seems to me that many of the features that they espouse could just as easily be handled by a separate program.  Of course, having a separate program does have its downsides, since it can make the startup logic more obtuse.

Also, I really like how in the ‘Miscellaneous’ table there’s a row for the SCM that is used.  I’m thinking “Who the hell cares?”.

Nov 01

Monitor System DBus

I’m currently writing a program which needs to listen to signals on the system DBus, and I needed a way to monitor the system bus.  I followed the directions here, but I came across a slight problem with that.  It turns out that the solution posted only allows you to listen for things that root sends out.  When I ran my program as an unprivileged user, I didn’t see any output in dbus-monitor, however I would see output if I ran the same program as root.  From what I can tell, the configuration posted will only allow you to see what root is sending on the bus, given that user=”root”.

Fortunately, there’s a simple fix for this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE busconfig PUBLIC
  "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>
  <policy context="default">
    <!-- Allow everything to be sent -->
    <allow send_destination="*" eavesdrop="true"/>
    <!-- Allow everything to be received -->
    <allow eavesdrop="true"/>
  </policy>
</busconfig>

Simply change the policy user to a policy context, and you can now see everything that’s on the bus.

As always, make sure that you remove this config once you’re done testing, otherwise it will be easy to circumvent security mechanisms that are in place.