FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing a module before suspend with systemd

    What is the right way to remove a module before suspend with systemd?

    I have buggy hardware that requires the psmouse module to be removed before the system is suspended in order to resume properly. With pm-utils pm-action you could put a file in /etc/pm/config.d which set a variable called SUSPEND_MODULES to remove the offending kernel module.

    In Fedora 19, if I run pm-suspend, everything still works fine. But if I click the Suspend menu option in Gnome 3, or close the lid of the laptop, the system arrives at the systemd suspend.target (somehow) and the psmouse kernel module is not removed.

    I see that I can put a script in /usr/lib/systemd/system-sleep that would be executed, but writing a script to load and unload psmouse via modprobe/rmmod seems... messy. Is there no clean way to do this, like in pm-utils?

  2. #2
    Join Date
    Jun 2007
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Removing a module before suspend with systemd

    FYI it does work if I create an executable file remove-psmouse.sh in /usr/lib/systemd/system-sleep:

    Code:
    $ cat /usr/lib/systemd/system-sleep/remove-psmouse.sh 
    #!/bin/bash
    [ "$1" = "post" ] && exec /usr/sbin/modprobe psmouse
    [ "$1" = "pre" ] && exec /usr/sbin/rmmod psmouse
    exit 0

  3. #3
    Join Date
    Jul 2011
    Location
    Poland
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Removing a module before suspend with systemd

    Thanks for sharing, I was in the similar situation. I had a problem with btusb module which stopped resetting my bluetooth chip properly during resume. Everything started to be wrong from kernel 3.10

    Cu

Similar Threads

  1. nvidia removing kernel module
    By m@! in forum Installation, Upgrades and Live Media
    Replies: 9
    Last Post: 23rd June 2009, 08:48 PM
  2. Automatic Removing and Add Module
    By ashishWaghmare in forum Hardware
    Replies: 3
    Last Post: 23rd June 2009, 05:31 PM
  3. I need help removing a module...
    By syzygy in forum Using Fedora
    Replies: 1
    Last Post: 18th June 2005, 05:35 AM
  4. Removing rivafb kernal module.
    By TheProgrammer in forum Using Fedora
    Replies: 9
    Last Post: 17th January 2005, 10:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •