[Bug 623290] New: pm-utils: /usr/lib/pm-utils/functions: line 87: log: command not found
http://bugzilla.novell.com/show_bug.cgi?id=623290 http://bugzilla.novell.com/show_bug.cgi?id=623290#c0 Summary: pm-utils: /usr/lib/pm-utils/functions: line 87: log: command not found Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Mobile Devices AssignedTo: mobile-bugs@forge.provo.novell.com ReportedBy: jnelson-suse@jamponi.net QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) Gecko/20100626 SUSE/3.6.6-1.2 Firefox/3.6.6 Found while debugging some suspend-to-ram issues on my laptop: /usr/lib/pm-utils/functions: line 87: log: command not found This appears to prevent subsequent kernel modules from being unloaded. Reproducible: Always Steps to Reproduce: 1. 2. 3. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623290 http://bugzilla.novell.com/show_bug.cgi?id=623290#c Uwe Drechsel <uwedr@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|mobile-bugs@forge.provo.nov |mvyskocil@novell.com |ell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623290 http://bugzilla.novell.com/show_bug.cgi?id=623290#c1 --- Comment #1 from Jon Nelson <jnelson-suse@jamponi.net> 2010-08-15 22:33:26 UTC --- More info: I think the files in /usr/lib/pm-utils/power.d/ and /usr/lib/pm-utils/sleep.d/ should be using: /usr/lib/pm-utils/pm-functions not /usr/lib/pm-utils/functions -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c2 --- Comment #2 from Till Dörges <td@pre-secure.de> 2010-08-22 15:40:29 UTC --- (In reply to comment #0)
/usr/lib/pm-utils/functions: line 87: log: command not found
This appears to prevent subsequent kernel modules from being unloaded.
As far as I understand the code from glancing over it, this is merely a cosmetic issue. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c3 --- Comment #3 from Jon Nelson <jnelson-suse@jamponi.net> 2010-08-22 18:01:39 UTC --- If the code is ever run in a context where a failed command results in an error (ie, set -e), then it's a problem. Futhermore, it's not _right_. The code is trying to execute a command which in this context does not exist. That's wrong, and it should be fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c4 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low Status|NEW |NEEDINFO InfoProvider| |jnelson-suse@jamponi.net --- Comment #4 from Michal Vyskocil <mvyskocil@novell.com> 2010-08-23 11:48:36 UTC --- Hi Jon, in which module have you found this problem? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c5 --- Comment #5 from Till Dörges <td@pre-secure.de> 2010-08-23 22:01:59 UTC --- (In reply to comment #4)
in which module have you found this problem?
I see it, when 75modules tries to unload a module which it can't unload. Also see 633496. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c6 --- Comment #6 from Michal Vyskocil <mvyskocil@novell.com> 2010-08-24 09:28:44 UTC --- And which command did you call when you see this error? Because all main pm-utils commands already sources /usr/lib/pm-utils/pm-functions, where log function is declared. $ rpm -ql pm-utils | grep bin | xargs grep pm-functions /usr/bin/pm-is-supported:. "/usr/lib/pm-utils/pm-functions" /usr/lib/pm-utils/bin/pm-action:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-hibernate:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-powersave:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-suspend:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-suspend-hybrid:. "/usr/lib/pm-utils/pm-functions" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c7 --- Comment #7 from Till Dörges <td@pre-secure.de> 2010-08-26 10:39:20 UTC --- (In reply to comment #6)
And which command did you call when you see this error? Because all main pm-utils commands already sources /usr/lib/pm-utils/pm-functions, where log function is declared.
$ rpm -ql pm-utils | grep bin | xargs grep pm-functions /usr/bin/pm-is-supported:. "/usr/lib/pm-utils/pm-functions" /usr/lib/pm-utils/bin/pm-action:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-hibernate:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-powersave:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-suspend:. "/usr/lib/pm-utils/pm-functions" /usr/sbin/pm-suspend-hybrid:. "/usr/lib/pm-utils/pm-functions"
I didn't call anything directly. My testcase was related to bug 633496. I.e. I put SUSPEND_MODULES="em28xx" into /etc/pm/config.d/terratec. Then I tried to suspend to disk. When 75modules is executed (automatically for the suspend, not by me), I find the above error message in /var/log/pm-suspend.log. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c8 --- Comment #8 from Vladimir Botka <vbotka@novell.com> 2010-09-01 11:55:43 UTC --- The problem is that 75modules uses PM_FUNCTIONS that points to functions. The log() is declared in the pm-functions. But pm-functions includes functions. IMHO the correct solution is to put the log() into the functions [2]. Could you try and test package [1]. [1] home:vbotka:branches:openSUSE:11.3:Update:Test/pm-utils [2] diff --git a/pm/functions.in b/pm/functions.in index 8388c65..b774b12 100644 --- a/pm/functions.in +++ b/pm/functions.in @@ -3,6 +3,16 @@ # Common functionality for the hooks. +# Simple little logging function. +# We do it this way because 'echo -n' is not posix. +log() +{ + is_set "$LOGGING" || return 0; + local fmt='%s\n' + [ "$1" = "-n" ] && { fmt='%s'; shift; } + printf "$fmt" "$*" +} + # If a variable is set to true, yes, 1, or is simply set with no value, # return 0, otherwise return 1. is_set() diff --git a/pm/pm-functions.in b/pm/pm-functions.in index dfbc59f..169029c 100644 --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -85,16 +85,6 @@ done . "${PM_FUNCTIONS}" -# Simple little logging function. -# We do it this way because 'echo -n' is not posix. -log() -{ - is_set "$LOGGING" || return 0; - local fmt='%s\n' - [ "$1" = "-n" ] && { fmt='%s'; shift; } - printf "$fmt" "$*" -} - profiling() { [ "$PM_PROFILE" = "true" ]; } if profiling; then -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c9 Till Dörges <td@pre-secure.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jnelson-suse@jamponi.net | --- Comment #9 from Till Dörges <td@pre-secure.de> 2010-09-04 21:41:11 UTC --- http://download.opensuse.org/repositories/home:/vbotka:/branches:/openSUSE:/... fixes the problem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c10 --- Comment #10 from Vladimir Botka <vbotka@novell.com> 2010-09-05 12:37:09 UTC --- (In reply to comment #9)
fixes the problem.
Thank you for testing. Created request id 47166 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c11 Vladimir Botka <vbotka@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |maintenance@opensuse.org --- Comment #11 from Vladimir Botka <vbotka@novell.com> 2010-09-06 20:41:33 UTC --- Created request id 47166 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c12 --- Comment #12 from Marcus Meissner <meissner@novell.com> 2010-09-07 07:00:07 UTC --- i think we should fix it, yes., +1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c13 Christian Dengler <cdengler@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW CC| |cdengler@novell.com InfoProvider|maintenance@opensuse.org | --- Comment #13 from Christian Dengler <cdengler@novell.com> 2010-09-07 14:25:05 UTC --- +1, update started. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c14 Swamp Workflow Management <swamp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| |maint:running:35694:low --- Comment #14 from Swamp Workflow Management <swamp@suse.com> 2010-09-07 14:25:35 UTC --- The SWAMPID for this issue is 35694. This issue was rated as low. Please submit fixed packages until 2010-10-05. Also create a patchinfo file using this link: https://swamp.suse.de/webswamp/wf/35694 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c15 Vladimir Botka <vbotka@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |cdengler@novell.com --- Comment #15 from Vladimir Botka <vbotka@novell.com> 2010-09-08 14:08:22 UTC --- Do I need the swamp to FActory either ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c Dirk Mueller <dmueller@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|cdengler@novell.com |maint-coord@suse.de -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c16 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|maint-coord@suse.de |vbotka@novell.com --- Comment #16 from Michal Vyskocil <mvyskocil@novell.com> 2010-09-13 11:40:03 UTC --- Hi guys, I'm little bit surprised there's already a SWAMPID and a patch. I do not think this is neither bug nor something should be fixed by maintenance update. As you can see in my comment#6 - every pm-utils command in /usr/(s)?bin/ sources the /usr/lib/pm-utils/pm-functions, where log command is defined. That means only one way user can face the missing log function is using pm-utils in a non-standard way, which is not supported. In other words, if you want to call something from /usr/lib/pm-utils directly, you have to source /usr/lib/pm-utils/pm-functions as a first step. Till, Vlado: if I'm wrong then please tell me which script did you use, because I'm not able to reproduce it. I understand that this requirement should be considered as annoying. But this should be discussed by upstream, not fixed by maintenance update. Please note that recent pm-utils-1.4.1 uses the same layout and I want to maintain less, not more SUSE pm-utils patches. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c17 Vladimir Botka <vbotka@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|vbotka@novell.com | --- Comment #17 from Vladimir Botka <vbotka@novell.com> 2010-09-13 12:20:11 UTC --- # grep -r PM_FUNCTIONS /usr/lib/pm-utils/ /usr/lib/pm-utils/pm-functions:PM_FUNCTIONS="$PM_UTILS_LIBDIR/functions" (In reply to comment #16)
Till, Vlado: if I'm wrong then please tell me which script did you use, because I'm not able to reproduce it.
The problem is that PM_FUNCTIONS variable points to functions. The script 75modules uses PM_FUNCTIONS. Details in Comment #8. # grep -r PM_FUNCTIONS /usr/lib/pm-utils/ /usr/lib/pm-utils/pm-functions:PM_FUNCTIONS="$PM_UTILS_LIBDIR/functions" <snip> -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c18 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO URL| |http://lists.freedesktop.or | |g/archives/pm-utils/2010-Se | |ptember/002220.html InfoProvider| |maintenance@opensuse.org --- Comment #18 from Michal Vyskocil <mvyskocil@novell.com> 2010-09-14 08:38:48 UTC --- So after a talk with Vlado and deeper look into the code I sent a patch which moves the definition of function log to pm/functions.in, because it is only one function used, but not defined in this file. http://lists.freedesktop.org/archives/pm-utils/2010-September/002220.html If and only if upstream will accept it, I'll vote for release of it as a maintenance update. If not, there are still two things should be fixed in 11.3, so we can reuse this SWAMPID http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568565 http://cgit.freedesktop.org/pm-utils/commit/?id=79dde6f2f7bb620b163981ec7a7b... https://bugzilla.novell.com/show_bug.cgi?id=633496 http://cgit.freedesktop.org/pm-utils/commit/?id=ef1e0968b93d2e3425183e6f1874... maintenance: are you OK with that? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c19 Christian Dengler <cdengler@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|maintenance@opensuse.org | --- Comment #19 from Christian Dengler <cdengler@novell.com> 2010-09-14 17:01:40 UTC --- (In reply to comment #15)
Do I need the swamp to FActory either ?
For Factory there is no need for a SwampID.
maintenance: are you OK with that? Yes, it is ok.
Be so kind and let me know, if you have a decision from upstream, then I can proofread the patchinfo and update it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c20 Swamp Workflow Management <swamp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|maint:running:35694:low |maint:running:35694:low | |maint:released:11.3:35724 --- Comment #20 from Swamp Workflow Management <swamp@suse.com> 2010-09-28 10:11:41 UTC --- Update released for: pm-utils, pm-utils-debuginfo, pm-utils-debugsource, pm-utils-ndiswrapper Products: openSUSE 11.3 (debug, i586, x86_64) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c Swamp Workflow Management <swamp@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|maint:running:35694:low |maint:released:11.3:35724 |maint:released:11.3:35724 | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c21 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |cdengler@novell.com --- Comment #21 from Michal Vyskocil <mvyskocil@novell.com> 2010-09-29 12:49:05 UTC --- Afaik the pm-utils was not updated, or I'm wrong? BTW: I still don't have a response from upstream. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c22 Christian Dengler <cdengler@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|cdengler@novell.com | --- Comment #22 from Christian Dengler <cdengler@novell.com> 2010-09-29 14:13:44 UTC --- Update was released with this as the last changes: rpm -qp --changelog pm-utils-1.3.0-10.1.1.i586.rpm | head -n 20 * Mi Sep 01 2010 vbotka@suse.de - 75modules uses PM_FUNCTIONS that points to functions. The log() is declared in the pm-functions. But pm-functions includes functions. Correct solution is to put the log() into the functions. (bnc#623290) * Mo Jul 05 2010 seife@opensuse.org - bash scripts are best if their logic is correct (bnc#619734) * Di Jun 29 2010 coolo@novell.com - bash scripts are better if they follow the syntax * Sa Jun 26 2010 seife@opensuse.org - fixes bnc#617667: 50rcnetwork sleep hook cannot work * Mi Jun 23 2010 mvyskocil@suse.cz - fixes bnc# 615646 - Suspending with upower/dk-power blocks the calling process * pm-utils-1.3.0-direct-on_ac_power.patch * Mo Jun 14 2010 mvyskocil@suse.cz - fixes bnc#603291: restart DHCP clients if traditional ifup is used Should be fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=623290 https://bugzilla.novell.com/show_bug.cgi?id=623290#c26 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #26 from Michal Vyskocil <mvyskocil@novell.com> 2010-10-06 11:48:47 UTC --- Update has been released, so lets close this one -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623290 http://bugzilla.novell.com/show_bug.cgi?id=623290#c27 --- Comment #27 from Bernhard Wiedemann <bwiedemann@suse.com> --- This is an autogenerated message for OBS integration: This bug (623290) was mentioned in https://build.opensuse.org/request/show/47166 11.3 / pm-utils -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com