8000 Hook scripts do not cancel a pending suspend · Issue #305 · elogind/elogind · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Hook scripts do not cancel a pending suspend #305
Open
@skiwarz

Description

@skiwarz

When a script in /etc/elogind/system-sleep/ prints a message to STDOUT beginning with any of {CANCELLED,CRITICAL,ERROR,FAILED}, the suspend operation should be canceled, and the machine remains awake. This does not happen.
I have the following example script in /etc/elogind/system-sleep

#!/bin/sh
case $1/$2 in
pre/*)
  if [[ $(ps aux | grep -E "gcc|emerge" | grep -v "grep") ]]; then
    echo -e "CANCELLED suspend due to my script"
    echo -e "CRITICAL suspend due to my script"
    echo -e "ERROR suspend due to my script"
    echo -e "FAILED suspend due to my script"
    exit 1
  fi
;;

This script does run, as I can see the output if I direct the echo commands to a file. However, the machine suspends anyways, regardless of the result of this script.

I'm currently using sys-auth/elogind-255.5-r2 on two different machines, one running a KDE desktop and the other fluxbox.
My sleep.conf contains:

[Sleep]
AllowSuspend=yes
AllowSuspendInterrupts=yes
SuspendState=mem
SuspendMode=deep

TODO:
Test version 252.9-r2 (the only other one in the portage tree)
Test if this occurs without an X environment (console only)

Metadata

Metadata

Assignees

Labels

buginvestigatingA reported issue is to be investigated

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0