You are not logged in.

#1 2010-10-27 20:59:49

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

[Gnome] execute rc.local after resume from hibernate/supsend [solved]

Hello guys,

At startup I set some configs by executing rc.local:

[robert@thinkpad ~]$ cat /etc/rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

# Enabling and controlling fan
echo 1 > /sys/devices/platform/lenovo-sl-laptop/hwmon/hwmon0/pwm1_enable
echo 70 > /sys/devices/platform/lenovo-sl-laptop/hwmon/hwmon0/pwm1

This works quite fine at startup but unfortunately this settings aren't enabled anymore when I resume my system from hibernation so that I have to execute rc.local manually again.

Can this be automatised using Gnome in any way? Maybe by executing rc.local after unlocking the system again?

Regards

Last edited by orschiro (2010-10-28 07:27:31)

Offline

#2 2010-10-28 05:41:00

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: [Gnome] execute rc.local after resume from hibernate/supsend [solved]

You need to put your commands in an executable file in /etc/pm/sleep.d . See here:
https://wiki.archlinux.org/index.php/Pm-utils


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2010-10-28 07:27:08

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: [Gnome] execute rc.local after resume from hibernate/supsend [solved]

Hello lagagnon,

thank you. I read a bit into it.

Here is one working script:

$ cat /etc/pm/sleep.d/60rc.local 
#!/bin/sh

. "${PM_FUNCTIONS}"

case $1 in
    resume|thaw)
        [ -e /etc/rc.local ] && /etc/rc.local &
        ;;
    *)
        exit $NA
        ;;
esac
exit 0

Offline

Board footer

Powered by FluxBB