<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=8193&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / How can I run a script on resume from hibernation?]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=8193</link>
		<description><![CDATA[The most recent posts in How can I run a script on resume from hibernation?.]]></description>
		<lastBuildDate>Mon, 14 Sep 2026 01:55:54 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65547#p65547</link>
			<description><![CDATA[<p>Yes, filing a bug for <span class="bbc">elogind</span> would be helpul. You file to Debian (bugs.debian.org) against the package although, I believe, upstream source is in Devuan&#039;s git store.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Mon, 14 Sep 2026 01:55:54 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65547#p65547</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65546#p65546</link>
			<description><![CDATA[<p>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:</p><p>Create <span class="bbc">/etc/elogind/system-sleep/your_script.sh</span></p><p>Make it executable.</p><p>Fill the contents:</p><div class="codebox"><pre><code>#!/bin/sh
if [ &quot;$1&quot; = &quot;post&quot; ]; then
    # Your wakeup commands here
    echo &quot;Woke up at $(date)&quot; &gt;&gt; /tmp/wakeup.log
fi</code></pre></div><p>This works. The <span class="bbc">$1</span> variable will be either &quot;pre&quot; or &quot;post&quot; for suspend or wakeup respectively.</p><div class="quotebox"><cite>ralph.ronnquist wrote:</cite><blockquote><div><p>iOr maybe you rely on logind in which case you&#039;d check out man loginctl instead</p></div></blockquote></div><p>...which gives the bad info (as Gemini did initially) that scripts in <span class="bbc">[/usr]/lib[64]/elogind/system-sleep</span> will be executed. In fact, empirical testing shows <strong>they are not</strong>. Only those in <span class="bbc">/etc/elogind/system-sleep/</span> 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?</p>]]></description>
			<author><![CDATA[dummy@example.com (Mercury)]]></author>
			<pubDate>Mon, 14 Sep 2026 01:35:21 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65546#p65546</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65543#p65543</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>@greenjeans that&#039;s just stupid.</p></div></blockquote></div><p><img src="https://dev1galaxy.org/img/smilies/lol.png" width="15" height="15" alt="lol" /></p><p>I&#039;m sure you&#039;re right, but it&#039;s fun to brainstorm, and in the end fsmithred go it to work with a similar simple hack, Not convinced my idea wouldn&#039;t work though, I may have to try it, though I don&#039;t typically use hibernate for anything.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Mon, 14 Sep 2026 01:16:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65543#p65543</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65539#p65539</link>
			<description><![CDATA[<p>Thanks. I got it to work with pm-hibernate. I put a simple script in /etc/sleep.d/testmessage and it ran. Just this...</p><div class="codebox"><pre><code>#!/usr/bin/env bash

echo &quot;$(date)&quot; &gt; /home/user/TESTMESSAGE

exit 0</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Sun, 13 Sep 2026 22:16:50 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65539#p65539</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65536#p65536</link>
			<description><![CDATA[<p>I&#039;ve got this script (for an example) from when I used to hibernate/suspend.&#160; It might require <del>pmtools</del> pm-utils (as Ralph noted above).</p><div class="codebox"><pre><code>#!/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 &quot;/etc/pm/sleep.d/50_network: Restoring network settings...&quot;
    # restore network settings
    /usr/local/sbin/netconfig.sh
    logger -s &quot;/etc/pm/sleep.d/50_network: Done.&quot;
    ;;
esac</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (rbit)]]></author>
			<pubDate>Sun, 13 Sep 2026 21:24:45 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65536#p65536</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65535#p65535</link>
			<description><![CDATA[<p>@greenjeans that&#039;s just stupid.</p><p>@fsmithred, tt of course depends on which hibernate-resume pathway you actually are using. Some go via <span class="bbc">pm-utils</span> and for that you may check out <span class="bbc">man pm-hibernate</span>. Or maybe you rely on <span class="bbc">logind</span> in which case you&#039;d check out <span class="bbc">man loginctl</span> instead.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Sun, 13 Sep 2026 21:23:18 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65535#p65535</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65532#p65532</link>
			<description><![CDATA[<p>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 <span class="bbc">RESUME=&lt;swap partition or whatever you use&gt; &amp;&amp; somescript.sh</span></p><p>Sounds hacky, but ya never know. Then update-initramfs and see what happens, lol.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Sun, 13 Sep 2026 20:29:49 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65532#p65532</guid>
		</item>
		<item>
			<title><![CDATA[How can I run a script on resume from hibernation?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=65530#p65530</link>
			<description><![CDATA[<p>If I want to run a script when resuming from hibernation, google tells me to do something with systemd. That&#039;s not an option. I poked around in /etc/acpi/ and /etc/elogind/ and I can&#039;t figure it out. I did read a few man pages, too. It&#039;s probably not difficult, but requires knowing where/what to tweak.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Sun, 13 Sep 2026 19:41:17 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=65530#p65530</guid>
		</item>
	</channel>
</rss>
