FS#31734 - [upower] /usr/lib/systemd/system-sleep/notify-upower.sh produces error when not called with "post"

Attached to Project: Arch Linux
Opened by pezcurrel (pezcurrel) - Saturday, 29 September 2012, 16:57 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Saturday, 17 November 2012, 04:28 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Ionut Biru (wonder)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

This should probably be filed to upstream, but I can't find a bug reporting tool for it...

Description:

Current upower version (0.9.18) ships with a "/usr/lib/systemd/system-sleep/notify-upower.sh" script which, as any script in that dir, gets called by systemd before sleep with "pre" argument and after wakeup with "post" argument.
The script's content is currently as follows...

--- begin script ---
#!/bin/bash
[ "$1" = "post" ] && exec /usr/bin/dbus-send \
--system --type=signal \
--dest=org.freedesktop.UPower \
/org/freedesktop/UPower \
org.freedesktop.UPower.Resuming
--- end script ---

For some reason, when it gets called by systemd before sleep (with "pre" argument), it exits with 1, so systemd produces an error message to the system journal, like this: "systemd-sleep[7909]: /usr/lib/systemd/system-sleep/notify-upower.sh exited with exit status 1."
This gets fixed by changing the script to something like the following.

--- begine script ---
#!/bin/bash
if [ "$1" = "post" ]; then
exec /usr/bin/dbus-send --system --type=signal --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Resuming
else
exit 0
fi
--- end script ---


Additional info:
* package version(s): extra/upower 0.9.18-2

Steps to reproduce:
put the pc to sleep, resume it, see the system journal
This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Saturday, 17 November 2012, 04:28 GMT
Reason for closing:  Upstream
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 29 September 2012, 17:43 GMT
  • Field changed: Summary (upower: /usr/lib/systemd/system-sleep/notify-upower.sh produces error when not called with "post" → [upower] /usr/lib/systemd/system-sleep/notify-upower.sh produces error when not called with "post")
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages: Extra → Upstream Bugs)
  • Task assigned to Ionut Biru (wonder)
Comment by Maxim Andersson (heddson) - Saturday, 10 November 2012, 15:41 GMT

Loading...