[kwlug-disc] Inconsistency in systemd ...

Khalid Baheyeldin kb at 2bits.com
Fri May 26 17:13:36 EDT 2017


Yes, this is another systemd rant ...

As many of you know, most distros have been adding more and more systemd
integration with their new releases.

Here is the use case: When I put the laptop to sleep, I want to unmount the
remote file systems, so that if I take the laptop outside the home network,
operations will not hang trying to access the server. I realize that if
there is a busy file system, that will fail, but most of the time I don't
have files open on the remote file system, so it should work.

The old way for triggering actions for sleep/hibernate/resume/...etc. was
to create a simple shell script and put it in /etc/pm/sleep.d. The first
argument will be the operation (hibernate, thaw, resume, ...etc.), and you
just check that, and act accordingly.

But in Ubuntu 16.04 and its variants, this no longer works. Why? Because
systemd decided that this is not the right way to do things, and instead
the script has to be in /lib/systemd/system-sleep/.

WHAT? A SCRIPT you say? You mean A SHELL SCRIPT? Wasn't the whole rationale
of systemd is to not write scripts because SCRIPTS ARE BAD, and use unit
file directives?

OK, let us ignore that, and see if it works.

Except that unmounting works intermittently: one file system will be
unmounted, the other will stay mounted. Next time I put the laptop to
sleep, the second one will be unmounted, maybe. Perhaps this is because the
network was already disabled by the time systemd got to the script?

WHAT? So NO ORDER OF EXECUTION? NO DEPENDENCIES and before/after order?
Wasn't these the rationale for systemd in the first place? There is no way
to specify order of execution, or prerequisites.

The systemd developers contradicted themselves here, twice.

And there are annoying side effects too. Sometimes, the Network Widget in
the notification area will be lost, and instead of a WiFi icon, it would
show the up/down arrow icon, and clicking on it will not show the current
connection, or other Wifi access points available. This is probably because
wpa_supplicant died or something.

Can't we have things that work?
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20170526/806b5494/attachment.htm>


More information about the kwlug-disc mailing list