Bug 434643 - Pm-utils runs script twice if overridden in /etc/pm
Pm-utils runs script twice if overridden in /etc/pm
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: pm-utils (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Phil Knirsch
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-23 15:03 EST by Philippe Troin
Modified: 2015-03-04 20:19 EST (History)
3 users (show)

See Also:
Fixed In Version: 1.x
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-31 16:18:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Philippe Troin 2008-02-23 15:03:37 EST
Description of problem:
I want to override the default script in
/usr/lib/pm-utils/sleep.d/10NetworkManager.  I've created a
/etc/pm/sleep.d/10NetworkManager script by copying it from
/usr/lib/pm-utils/sleep.d/10NetworkManager.
However, then the /etc/pm/sleep.d/10NetworkManager script is ran twice on
suspend and twice on resume.

Version-Release number of selected component (if applicable):
pm-utils-0.99.4-6.fc8.x86_64

How reproducible:
Always.

This patch fixes the problem:
--- /usr/lib/pm-utils/functions 2007-10-23 13:34:34.000000000 -0700
+++ ./functions 2008-02-23 12:02:41.000000000 -0800
@@ -60,7 +60,7 @@
 find_sleepd_files()
 {
        flist="/etc/pm/sleep.d/*[^~] /usr/lib/pm-utils/sleep.d/*[^~]"
-       bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -n)
+       bases=$(for file in $flist ; do echo $(basename $file) ; done | sort -nu)
        for base in $bases ; do
                if [ -e "/etc/pm/sleep.d/$base" ]; then
                        if [ -x "/etc/pm/sleep.d/$base" ]; then
Comment 1 Richard Hughes 2008-04-08 03:54:53 EDT
Is this fixed with the pm-utils upstream? http://pm-utils.freedesktop.org/wiki/
Comment 2 Philippe Troin 2008-07-31 15:35:38 EDT
I can't tell, the code has been completely reorganized and I cannot find the
find_sleepd_files function.

Do you have a packaged version of pm-utils in rawhide?

Phil.
Comment 3 Till Maas 2008-07-31 15:59:58 EDT
(In reply to comment #2)
> I can't tell, the code has been completely reorganized and I cannot find the
> find_sleepd_files function.
> 
> Do you have a packaged version of pm-utils in rawhide?

F9 and Rawhide have packages with the reorganized code, I believe this is fixed
now, the code to find the hooks is now in
pm/pm-functions.in
(http://cgit.freedesktop.org/pm-utils/tree/pm/pm-functions.in) in the function
run_hooks()
Comment 4 Philippe Troin 2008-07-31 16:05:44 EDT
Yes, it does look fixed.
I'll let you close the bug.

Phil.

Note You need to log in before you can comment on or make changes to this bug.