You are not logged in.

#1 2012-11-28 21:32:19

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

[solved] pm-utils script working after hibernation or suspend

Hello,

I have a script /etc/pm/sleep.d/90_startup which contains the following code:

#!/bin/sh

case $1 in
    resume)
        /home/orschiro/.startup
        ;;
    thaw)
        /home/orschiro/.startup
        ;;
    *)
        /home/orschiro/.startup
        ;;
esac

However, it is not run on resume. I am using Gnome 3.6. Is there something with Gnome that prevents running the script?

Last edited by orschiro (2012-12-01 07:47:02)

Offline

#2 2012-11-29 21:16:38

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

Re: [solved] pm-utils script working after hibernation or suspend

No ideas?

Offline

#3 2012-11-30 20:02:13

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: [solved] pm-utils script working after hibernation or suspend

Are there any other hooks that you know are run?

I presume this might be related to systemd not running pm-utils hook nor custom hooks if you have set it to handle ACPI events.
Check out the wiki in order to know where to place your script or try to convert it to a systemd unit file.


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#4 2012-12-01 07:46:48

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

Re: [solved] pm-utils script working after hibernation or suspend

Thank you so much, root. You pointed me into the right direction. I have never thought about it that pm hooks simply could not be called due to systemd.

I have a working custom script now.

Just two final questions.

1. The custom scripts are located in /usr/lib. Will they be overwritten or deleted with updates of systemd? Why are they not located in /etc?
2. Am I safe to remove pm-utils now?

Offline

#5 2012-12-02 01:12:53

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: [solved] pm-utils script working after hibernation or suspend

I don't think you should be worried about your scripts being overwritten. As far as I know, and as the wiki states, if you had personalized a unit file from /usr/lib/systemd/system/ and left it in the same folder there would be a chance for that unit to be overwritten by future updates. But the scripts, again as far as I know, are not affected by this.
In the same way, you can even try to convert your scripts to systemd unit files and keep them in /etc/systemd/system as that is the way it actually should be done. A previous version of the wiki recommended this as using scripts was considered 'hacking' and only useful on a local basis. But it seems it now has been removed from the wiki and it is too an accepted way of handling this kind of things.

It is up to you to know if you still have need for the pm-utils package. That is, if any other package you still want to use depends on it. Make sure to use the recursive option when removing it and pacman will most likely tell you.


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#6 2012-12-02 10:24:27

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

Re: [solved] pm-utils script working after hibernation or suspend

convert your scripts to systemd unit files and keep them in /etc/systemd/system

So basically making a service out of them?

Are there any steps that I can follow to create the unit files?

Offline

#7 2012-12-02 18:05:31

firecat53
Member
From: Sammamish, Wa
Registered: 2007-05-14
Posts: 1,444
Website

Re: [solved] pm-utils script working after hibernation or suspend

Sorry I haven't updated the wiki yet, but this post should help.

Scott

Offline

Board footer

Powered by FluxBB