<div dir="ltr"><div><div><div><div>Yes, this is another systemd rant ... <br><br>As many of you know, most distros have been adding more and more systemd integration with their new releases. <br><br>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. <br><br>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.<br></div><br></div>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/. <br><br>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? <br></div><br></div><div>OK, let us ignore that, and see if it works. <br><br></div>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? <br><br>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.<br><div><div><div><div><div><div><div><br>The systemd developers contradicted themselves here, twice.<br><br></div><div>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.<br><br></div><div>Can't we have things that work? <br></div><div>-- <br><div class="gmail_signature">Khalid M. Baheyeldin<br><a href="http://2bits.com" target="_blank">2bits.com</a>, Inc.<br>Fast Reliable Drupal<br>Drupal optimization, development, customization and consulting.<br>Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. -- Leonardo da Vinci<br>For every complex problem, there is an answer that is clear, simple, and wrong." -- H.L. Mencken<br></div>
</div></div></div></div></div></div></div></div>