Power Management: Difference between revisions

m Added a lang="text" to syntaxhighlight
Sandro (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 30: Line 30:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  systemd.services.your-service-name = {  
systemd.services.your-service-name = {  
    description = "Service description here";
  description = "Service description here";
    wantedBy = [ "post-resume.target" ];
  wantedBy = [ "post-resume.target" ];
    after = [ "post-resume.target" ];
  after = [ "post-resume.target" ];
    script = ''
  script = ''
     echo "This should show up in the journal after resuming."
     echo "This should show up in the journal after resuming."
    '';
  '';
    serviceConfig.Type = "oneshot";
  serviceConfig.Type = "oneshot";
  };
};
</syntaxhighlight>
</syntaxhighlight>


Line 48: Line 48:


Therefore, an example configuration could look like this:<syntaxhighlight lang="nix">
Therefore, an example configuration could look like this:<syntaxhighlight lang="nix">
/*
// I'm hibernating into a logical volume that's also under LUKS. Pretty cool, right?
  I'm hibernating into a logical volume that's also under LUKS. Pretty cool, right?
*/


swapDevices = [
swapDevices = [
Line 200: Line 198:
</syntaxhighlight>
</syntaxhighlight>


The <code>pre-sleep-start</code> script referenced by <code>ExecStart</code> contained directives installed by the [[Displaylink]] package, that contained a flush operation which hung the suspend action. Starting <code>dlm.service</code> or running <code>sudo DisplayLinkManager</code> unblocks the script and made suspend work normally.  
In this case, the <code>pre-sleep-start</code> script referenced by <code>ExecStart</code> contained directives installed by the [[Displaylink]] package, that contained a flush operation which hung the suspend action. Starting <code>dlm.service</code> or running <code>sudo DisplayLinkManager</code> unblocks the script and made suspend work normally.  


==== Cancelling an existing suspend action ====
An existing suspend operation that is hung may be interrupted using <code>'''systemctl cancel'''</code> in case reboots or internet access is needed.  
An existing suspend operation that is hung may be interrupted using <code>'''systemctl cancel'''</code> in case reboots or internet access is needed.