You are not logged in.
Pages: 1
If I want to run a script when resuming from hibernation, google tells me to do something with systemd. That's not an option. I poked around in /etc/acpi/ and /etc/elogind/ and I can't figure it out. I did read a few man pages, too. It's probably not difficult, but requires knowing where/what to tweak.
Offline
Possibly add something in /etc/initramfs-tools/conf.d , I use it to get rid of boot warnings (RESUME=none), but possibly add a line about running the script after resuming normally? So maybe RESUME=<swap partition or whatever you use> && somescript.sh
Sounds hacky, but ya never know. Then update-initramfs and see what happens, lol.
Last edited by greenjeans (Yesterday 20:32:58)
https://sourceforge.net/projects/vuu-do/ Vuu-do GNU/Linux, Devuan-based Openbox systems.
Devuan 6 mate-mini iso, pure Devuan, 100% no-vuu-do. Now with Xlibre as well.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
https://devuanusers.com/ Apps source : https://git.devuan.org/greenjeans
Offline
@greenjeans that's just stupid.
@fsmithred, tt of course depends on which hibernate-resume pathway you actually are using. Some go via pm-utils and for that you may check out man pm-hibernate. Or maybe you rely on logind in which case you'd check out man loginctl instead.
Offline
I've got this script (for an example) from when I used to hibernate/suspend. It might require pmtools pm-utils (as Ralph noted above).
#!/bin/bash
# Script name: /etc/pm/sleep.d/50_network
# Purpose: Restore network settings upon thaw / resume
case $1 in
suspend|suspend_hybrid|hibernate)
:
;;
resume|thaw)
# wait 10s for network to come back
sleep 10
logger -s "/etc/pm/sleep.d/50_network: Restoring network settings..."
# restore network settings
/usr/local/sbin/netconfig.sh
logger -s "/etc/pm/sleep.d/50_network: Done."
;;
esacOffline
Thanks. I got it to work with pm-hibernate. I put a simple script in /etc/sleep.d/testmessage and it ran. Just this...
#!/usr/bin/env bash
echo "$(date)" > /home/user/TESTMESSAGE
exit 0Offline
@greenjeans that's just stupid.
![]()
I'm sure you're right, but it's fun to brainstorm, and in the end fsmithred go it to work with a similar simple hack, Not convinced my idea wouldn't work though, I may have to try it, though I don't typically use hibernate for anything.
https://sourceforge.net/projects/vuu-do/ Vuu-do GNU/Linux, Devuan-based Openbox systems.
Devuan 6 mate-mini iso, pure Devuan, 100% no-vuu-do. Now with Xlibre as well.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
https://devuanusers.com/ Apps source : https://git.devuan.org/greenjeans
Offline
This is timely as I had a similar problem on my checklist. After consulting Gemini and getting past its initial wrong answer, I got the following, which works with elogind, which is what I got installed by default in Devuan:
Create /etc/elogind/system-sleep/your_script.sh
Make it executable.
Fill the contents:
#!/bin/sh
if [ "$1" = "post" ]; then
# Your wakeup commands here
echo "Woke up at $(date)" >> /tmp/wakeup.log
fiThis works. The $1 variable will be either "pre" or "post" for suspend or wakeup respectively.
iOr maybe you rely on logind in which case you'd check out man loginctl instead
...which gives the bad info (as Gemini did initially) that scripts in [/usr]/lib[64]/elogind/system-sleep will be executed. In fact, empirical testing shows they are not. Only those in /etc/elogind/system-sleep/ are, which shows once again that bad documentation is worse than no documentation. I suppose I should be expected to file a bug to fix the docs?
Last edited by Mercury (Today 01:48:38)
Online
Yes, filing a bug for elogind would be helpul. You file to Debian (bugs.debian.org) against the package although, I believe, upstream source is in Devuan's git store.
Offline
Pages: 1