2

Brief background information: I just installed Fedora 18 with Gnome 3.6.3.1 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?

  • Thanks for this command! It helped a lot in my troubleshooting. – Meta Jun 2 '13 at 4:13
2

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:

this._upClient.suspend_sync(null);

By the following line:

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

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

const Util = imports.misc.util;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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