Living without Poettering

(or how I learned to kill the kits and love autofs) #

Yes. It’s that hot potato topic. Recent developments in the systemd world… Need I go on? I’m not impressed. It seems to me that Systemd is being called for as a replacement (in part) for ConsoleKit and PolKit, which are products of the same school of bodge-it job coding and bugger all documentation.

So! As a result of. I decided to see how easy it would be to live without the various mangled and largely undocumented bits of spaghetti code. Note I’m doing this on Gentoo. Trying to untangle the dependency hell in other distro’s may be much more of a pain in the …. anyway … here’s what I learnt…

Pulseaudio #

One of Poettering’s earlier works. Uninstalls blissfully easily. Thankfully it leeches off alsa so just about everything under the sun will still run happily with plain alsa instead. I’ve had no problems at all. I’ve not even had to configure a single file. It just works. System tray control is now provided with PNMixer, and the guified alsa controls are provided by QASTools. Job done.

Systemd #

Being on Gentoo has made this utter bliss. I didn’t have a scrap of systemd installed in the first place. OpenRC works beautifully well and I can’t see any advantages in the Systemd approach at all. Suffice to say, there are other init managers and they are very competent.

Udev #

An easy drop in replacement exists called eudev. Not only was it entirely painless to put in place (just emerge it, and it helpfully unmerges udev for you!). But … eth0 is back!!! I can’t explain the joy of not having to remember enp4s1 or whatever the hell udev thought I should call it.

ConsoleKit & PolKit & Udisks #

Slightly more fun. Partly because the genius coders here have made the modules depend on each other, so you can’t reach a point in Gentoo where they neatly uninstall themselves with a clean up pass. So it’s a case of flip your use flags to -, add:

sys-auth/consolekit
sys-auth/polkit
sys-fs/udisks
gnome-extra/polkit-gnome

To the package.mask file. Then untangle and unmerge and dependencies revealed from tricks like:

qdepends -Q consolekit

It actually didn’t take that long to untangle the mess. LightDM had to go. I can live with that. I was expecting to go back to a “startx” scenario anyway and haven’t yet investigated replacements that might work. LXDM, cdm and wdm look like they might happily exist, but I’ve not tried them.

When you’ve untangled the mess far enough, just:

emerge --unmerge consolekit polkit
emerge --ask --update --deep --with-bdeps=y --newuse @world
emerge --ask --depclean

From memory, udisks happily vanished at this point. YMMV.

But wait I minute! I needed all that ####! #

No you don’t.
Here are two perfectly good ways of getting your easy drive mounting back (there are more, see spacefm, udevil, uam, pmount & others).

I use pcmanfm as my gui file manager, so I still have a bunch of gvfsd daemons hanging around. This is a good thing. We can use them. (Clementine can use this trick as well).

pcmanfm / gvfsd abide by the rules in /etc/fstab so! Plug in your USB thangs and as root:

blkid

Will give you a neat list of UUID’s for various devices. If you can’t tell which is which, just plug them in one at a time (k.i.s.s.). We need the UUID for predictable mounting in /etc/fstab. Now edit fstab and add something like this:

UUID="001A-3768"   /mnt/mp3player   auto   noauto,user,uid=#####,gid=users   0   0

For each device. (That’s all supposed to be on one line). You need to create the mount point directory. Of course, you can fiddle with the mount options to your hearts content, (replace the ##### with your user name, and the UUID with whatever your blkid list gave you), but that’s basically it.

Lo and behold. pcmanfm and clementine and presumably a bunch of other apps will now happily let you mount and unmount your USB sticks / mp3players / sdcards and that sort of beast. (Actually, you need to use pcmanfm to unmount the device to keep Clementine happy, but it’s more a glitch than a problem). No polkit or consolekit or udisks required … and there’s most the Linux world thinking they are essential.

But wait! Network drives and other stuffs! #

Yup. Kernel to the rescue!
For this we have the awesome AutoFS (which you could actually easily also use to mount your USB things as well, but I wanted pcmanfm & clementine to work nicely, and they don’t talk to autofs much). You might need to recompile your kernel with automount enabled. See here, which also gives you pointers on how to use autofs for your “misc” usb devices etc. And here, which tells you what I’m about to…

Autofs gives you a few minimal /etc/autofs files. I wanted nice neat auto mounting samba servers. Yes I know. My main video collection is on a Windows box. Don’t ask. Anyway!

To auto.master I added a line:

/mnt/lan    /etc/autofs/lan.net     --timeout=60

Which is going to auto mount my samba drives under the subdirectory /mnt/lan according to the rules in lan.net. Sadly, lan.net doesn’t exist so remedy that, and stick a line in it along the lines of:

sambadisk   -fstype=cifs,username=#####,password=#####,uid=#####,gid=users ://somepc.lan/nameofthedisk

That should all be one line. Replace bits as required and you should (assuming you remembered to start the autofs service), be able to seamlessly browse your lan samba shares. It’ll even unmount them 60 seconds after you stop using them. How neat is that?

Note: That Arch wiki link also gives information on how to mount fuse devices like Android phones and mtp things via automount. I’ve not bothered with it since the gvfsd daemons run by pcmanfm do all that for me, but it’s nice to know it’s there.

The Result #

I now have a perfectly functional, stable and very predictable system. It’s drastically less dependant on the bits of Gnome / RedHat / Poettering / Sievers code that keep being pushed on the Linux community as “essential vast improvements”. It doesn’t need to run a Display Manager just to ensure that the right processes get launched to let me do what I want. It just does what I want. It’s hard to say if I’ve saved any memory, from a quick glance, it looks like around 150MB less code sloshing around in memory.

For those with any interest. I’m now running an openbox based desktop, pcmanfm as the filemanger, compton for basic composite effects, fbpanel for a nice functional panel with system tray and dunst for notifications. Dunst was a real find. I actually like it more than any other notification popup I’ve tried. Very tweak-able.

As ever. My huge thanks and gratitude to the authors, contributors and bug squishers for all the sane, Linux philosophy friendly software and utilities that are out there. A big “go fork your own OS then” to every one else.

 
8
Kudos
 
8
Kudos

Now read this

A mini Lingwin N1 mobile phone review

If you avoided buying the AIEK C6 in the last mini review, you might have spotted the Lingwin N1 at around the same price range. It’s this thing: http://lingwin.hk/en/product/n1 So here’s another mini review for another mini phone. The... Continue →