<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add Avoid field to handle sleep modi (hibernate, suspend, hybrid)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85169">85169</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Add Avoid field to handle sleep modi (hibernate, suspend, hybrid)
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>high
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ewl+freedesktop@lavar.de
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>After managing to get my (Debian) system to properly go sleeping using systemd
without the pm framework, I ended with a quite ugly solution where I have a
service that depends on sleep and stops things at start time and (re-)start
them at stop time, so that devices and services that don't like sleep modes are
stopped before and restarted after.
If I didn't miss anything, there isn't such a feature yet, so I would suggest
to add something like a new "Avoid=" field, which would mean for systemd:
- stop the unit before the avoided unit is started
- note down the stopped unit and all stopped dependencies
- once the avoided unit has been stopped, restart all the avoiding units and
what depends on them that was stopped
In this way, a simple "Avoid=sleep.target" added to a service definition would
allow for such units sensible to sleep modes to be stopped and re-started
properly.
A "Avoid=shutdown.target" could similarly be used to have services not starting
automatically to survive a reboot/shutdown cycle if they've been started
manually before.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>