Skip to content

Instantly share code, notes, and snippets.

@joshp23
Created December 10, 2020 12:39
Show Gist options
  • Save joshp23/5be872e63454008a46b237b0e9844b98 to your computer and use it in GitHub Desktop.
Save joshp23/5be872e63454008a46b237b0e9844b98 to your computer and use it in GitHub Desktop.
Ubuntu systerm service file to reload wife after suspend
#/etc/systemd/system/wifi-resume.service
#sudo systemctl enable wifi-resume.service
[Unit]
Description=Restart Network Manager at resume (after suspend)
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
# alternative command to call
#ExecStart=/usr/bin/systemctl restart NetworkManager.service
# note: also unloads iwlwifi
ExecStart=/usr/sbin/modprobe -r iwldvm
# note: also loads iwldvm
ExecStart=/usr/sbin/modprobe iwlwifi
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
@joshp23
Copy link
Author

joshp23 commented Dec 10, 2020

Fixes the "Wifi not working after suspend" problem.

  • place the file at: /etc/systemd/system/wifi-resume.service
  • run the command: sudo systemctl enable wifi-resume.service
  • test by putting the computer in suspend and waking it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment