Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Brief background information: I just installed Fedora 18 with Gnome on my computer. It is connected to a Windows share (CIFS) containing music, which I play using Clementine. If I suspend the computer while Clementine is playing a song from the CIFS mount, upon resuming, it (Clementine) hangs. Eventually, if I try to restart/power off, the whole computer hangs. My workaround to this is to stop playback upon suspension.

My problem: I've created a script in /usr/lib/systemd/system-sleep to stop playback (using MPRIS). The script successfully runs before suspend if I execute

systemctl suspend

However, it does not run if I click on Suspend from the User menu in Gnome3. Doing some legwork, I uncovered that Gnome3 relies on UPower, which itself, it seems, simply uses DBus to issue the "Suspend" command. I'm not savvy enough to follow the trail any further, but from what I can see, the script never gets executed.

My question: How can I make the Suspend menu item in Gnome3 use systemd to call my script?

share|improve this question
Thanks for this command! It helped a lot in my troubleshooting. – Meta Jun 2 '13 at 4:13
up vote 2 down vote accepted

After doing some more research, it seems like UPower should indeed use systemd when it is detected. But for some reason, it does not. I am currently looking into this, but as a temporary workaround, I directly edited the relevant lines in userMenu.js and powerMenu.js as follow:

Replace (comment out) all the lines that call suspend:


By the following line:

Util.spawn(['systemctl', 'suspend']);

Also add the following line in powerMenu.js near the top:

const Util = imports.misc.util;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.