Bug 749031 - pm-utils-1.4.1-5.11.1.i586 misses functions and script 50rcnetwork contains errors
Summary: pm-utils-1.4.1-5.11.1.i586 misses functions and script 50rcnetwork contains e...
Status: VERIFIED FIXED
Alias: None
Product: openSUSE 11.4
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 openSUSE 11.4
: P3 - Medium : Major with 6 votes (vote)
Target Milestone: ---
Deadline: 2012-03-28
Assignee: Vojtech Dziewiecki
QA Contact: E-mail List
URL:
Whiteboard: .
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-26 12:24 UTC by Guy Zelck
Modified: 2012-05-11 12:00 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Proposed patch (986 bytes, patch)
2012-02-27 12:37 UTC, Marius Tomaschewski
Details | Diff
revised pm-utils-dhcp-interfaces.patch (1.31 KB, patch)
2012-02-28 04:39 UTC, Bin Li
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Zelck 2012-02-26 12:24:47 UTC
User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

1. functions dhcp_clients, save_state and restore_state are missing from the package or the 11.4 distribution so this script cannot work as supposed to.

2.command_exists dhcp_clients || exit $NA
Early in the script this test will make you exit. So nothing will be processes for Networkmanager or ifup/ifdown setups.

3. [ x"${NETWORKMANAGER}" -eq x"yes" ] && exit $NA
If you compare strings you need to use "=", not "-eq".

Reproducible: Always

Steps to Reproduce:
1.suspend to disk
2.ressume from disk
3. => no wlan0 8-(

I have a desktop with a wireless main connection (wlan0) set up with ifdown/ifup because the box needs to function as a network server at home.

In stead of shutting down I use "suspend to disk" which functionally works great. Ofcourse, the scripts need to be correct to realy enjoy it.




It's easily fixed but as of now if breaks a main feature. So please give this priority as it makes Linux and Opensuse look bad.
Comment 1 Bin Li 2012-02-27 09:28:31 UTC
Guy,

(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101
> Firefox/10.0.1
> 
> 1. functions dhcp_clients, save_state and restore_state are missing from the
> package or the 11.4 distribution so this script cannot work as supposed to.
Looks the save_state/restore_state change to savestate/restorestate.
dhcp_clients change to dhcp_interfaces? Not sure.

> 2.command_exists dhcp_clients || exit $NA
> Early in the script this test will make you exit. So nothing will be processes
> for Networkmanager or ifup/ifdown setups.
Yes, it doesn't work anymore.

> 3. [ x"${NETWORKMANAGER}" -eq x"yes" ] && exit $NA
> If you compare strings you need to use "=", not "-eq".
Yes, we should change it.
Comment 2 Bin Li 2012-02-27 09:29:45 UTC
Marius,

 Do you know the meaning of dhcp_clients? Thanks!
Comment 3 Marius Tomaschewski 2012-02-27 10:40:27 UTC
I've no idea. I'll look into pm-utils.
Comment 4 Bin Li 2012-02-27 11:14:02 UTC
(In reply to comment #3)
> I've no idea. I'll look into pm-utils.

Thanks for quick reply, and this network script was added at bnc#603291, it's in pm-utils-suse which owned by suse-self. :)
Comment 5 Marius Tomaschewski 2012-02-27 12:34:37 UTC
I've no idea where the dhcp_clients should be from -- I've extracted pm-utils
(and sysconfig from 11.2 [-> bnc#603291]), but I were unable to find it too.

I think, Michal wanted to check / call the dhcp_interfaces() function from
/etc/sysconfig/network/scripts/functions to get a list of all interfaces
where a dhcp client is currently running...
Comment 6 Marius Tomaschewski 2012-02-27 12:37:10 UTC
Created attachment 478133 [details]
Proposed patch
Comment 7 Guy Zelck 2012-02-27 21:41:54 UTC
The attachment is not quite correct.

I followed Bin Li's leads, adapted the script and did a suspend/resume test => OK.

The body of the script should have this in it :

============================================================================
. "${PM_FUNCTIONS}"

# Sanity checks
[ -x /etc/init.d/network ] || exit $NA
[ -r /etc/sysconfig/network/config ] && . /etc/sysconfig/network/config
[ -r /etc/sysconfig/network/scripts/functions ] && . /etc/sysconfig/network/scripts/functions

command_exists dhcp_interfaces || exit $NA

# NetworkManager is handled by 55NetworkManager, so skip this script if
# nm is enabled in sysconfig ...
[ x"${NETWORKMANAGER}" = x"yes" ] && exit $NA
# ... or if it is running
command_exists nm_running && nm_running && exit $NA

case "$1" in
    hibernate|suspend)
        savestate "dhcp_interfaces" "`dhcp_interfaces`"
        service network stop-all-dhcp-clients
        ;;
    thaw|resume)
        for interface in `restorestate "dhcp_interfaces"`; do
            service network restart ${interface}
        done
        ;;
    *) exit $NA
        ;;
esac

============================================================================

Thanks for the quick reaction.
Comment 8 Bin Li 2012-02-28 03:10:15 UTC
(In reply to comment #6)
> Created an attachment (id=478133) [details]
> Proposed patch

Thanks a lot!
Comment 9 Bin Li 2012-02-28 03:10:47 UTC
(In reply to comment #7)
> The attachment is not quite correct.
> 
> I followed Bin Li's leads, adapted the script and did a suspend/resume test =>
> OK.
> 
> The body of the script should have this in it :
> 
> ============================================================================
> . "${PM_FUNCTIONS}"
> 
> # Sanity checks
> [ -x /etc/init.d/network ] || exit $NA
> [ -r /etc/sysconfig/network/config ] && . /etc/sysconfig/network/config
> [ -r /etc/sysconfig/network/scripts/functions ] && .
> /etc/sysconfig/network/scripts/functions
> 
> command_exists dhcp_interfaces || exit $NA
> 
> # NetworkManager is handled by 55NetworkManager, so skip this script if
> # nm is enabled in sysconfig ...
> [ x"${NETWORKMANAGER}" = x"yes" ] && exit $NA
> # ... or if it is running
> command_exists nm_running && nm_running && exit $NA
> 
> case "$1" in
>     hibernate|suspend)
>         savestate "dhcp_interfaces" "`dhcp_interfaces`"
>         service network stop-all-dhcp-clients
>         ;;
>     thaw|resume)
>         for interface in `restorestate "dhcp_interfaces"`; do
>             service network restart ${interface}
>         done
>         ;;
>     *) exit $NA
>         ;;
> esac
> 
> ============================================================================
> 
> Thanks for the quick reaction.

Thanks for your feedback.
Comment 10 Bin Li 2012-02-28 03:11:19 UTC
Michal,

 Could we let in updates? Thanks!
Comment 11 Bin Li 2012-02-28 03:16:13 UTC
BTW, it also affect the 12.1, the same issue.
Comment 12 Bin Li 2012-02-28 04:39:59 UTC
Created attachment 478254 [details]
revised pm-utils-dhcp-interfaces.patch

It based on Marius' patch, just add restorestate.

It make sense to put 'command_exists dhcp_clients' after check NM status.
Comment 13 Bin Li 2012-02-28 04:46:20 UTC
Anyway I just update it to 12.1.

Request: #107316

  submit:       home:BinLi:branches:openSUSE:12.1:Update/pm-utils  -> openSUSE:12.1:Update:Test


Message:
fix script 50rcnetwork error and update savestate/restorestate functions(bnc#749031).

State:   review     2012-02-28T05:45:30 BinLi
Comment 14 Bernhard Wiedemann 2012-02-28 05:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/107316 12.1 / pm-utils
Comment 15 Bin Li 2012-02-28 06:12:26 UTC
Maintenance,

 Could we let it in updates? Thanks!
Comment 16 Michal Vyskocil 2012-02-28 14:48:12 UTC
Cool, do you think you can do it for 11.4 as well?

BTW: added to git and pushed fix to Factory
http://gitorious.org/opensuse/pm-utils-suse/commit/41cb0c42e5f739b73d66f7a5de0d6d4d92b3c375
Comment 17 Bernhard Wiedemann 2012-02-28 15:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/107429 Factory / pm-utils
Comment 18 Benjamin Brunner 2012-02-29 08:47:21 UTC
We will start an update for 11.4 and 12.1 after it is checked in into factory. Please have a look at the decline-message in the factory-submission.
For the 11.4 update I'll provide a SWAMP-ID
Comment 19 Swamp Workflow Management 2012-02-29 08:49:40 UTC
The SWAMPID for this issue is 45819.
This issue was rated as low.
Please submit fixed packages until 2012-03-28.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/45819
Comment 20 Michal Vyskocil 2012-02-29 09:52:49 UTC
(In reply to comment #18)
> We will start an update for 11.4 and 12.1 after it is checked in into factory.
> Please have a look at the decline-message in the factory-submission.
> For the 11.4 update I'll provide a SWAMP-ID

Hallo Benjamin,

I do not understood why you declined the Bin's request - one would expect that update by adding a patch is a preferred workflow for maintenance update. The Factory update is different, but because I have all suse additions in pm-utils-suse (and have a plan to rebase it completelly), so for Factory I've merged all stuff here.

So please accept the 107316 as I see nothing bad (well, convert of VTxx patch is not really needed, so here I would expect some problems)
Comment 21 Bernhard Wiedemann 2012-02-29 10:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/107518 12.1 / pm-utils
https://build.opensuse.org/request/show/107519 Factory / pm-utils
Comment 22 Bin Li 2012-02-29 10:55:41 UTC
resubmit with swampid information. 12.1 and 11.4.

107532  State:new        By:BinLi        When:2012-02-29T11:53:13
        submit:          home:BinLi:branches:openSUSE:11.4:Update:Test/pm-utils  -> openSUSE:11.4:Update:Test
        Descr: fix script 50rcnetwork error and update savestate/restorestate
               functions(bnc#749031,swampid#45819). 

107518  State:review     By:BinLi        When:2012-02-29T10:40:11
        submit:          home:BinLi:branches:openSUSE:12.1:Update/pm-utils  -> openSUSE:12.1:Update:Test
        Review by Group      is new:       maintenance-opensuse.org                          
        Descr: fix script 50rcnetwork error and update savestate/restorestate
               functions(bnc#749031,swampid#45819).
Comment 23 Bernhard Wiedemann 2012-02-29 11:00:28 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/107532 11.4 / pm-utils
Comment 24 Bernhard Wiedemann 2012-02-29 13:00:19 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/107546 11.4 / pm-utils
Comment 25 Benjamin Brunner 2012-03-05 13:05:44 UTC
Update for 11.4 and 12.1 already started. Thanks for the submission again and I will remove the needinfo.
Comment 26 Swamp Workflow Management 2012-03-08 13:18:55 UTC
Update released for: pm-utils, pm-utils-debuginfo, pm-utils-debugsource, pm-utils-ndiswrapper
Products:
openSUSE 11.4 (debug, i586, x86_64)
Comment 27 Michal Vyskocil 2012-03-27 08:35:46 UTC
moved to the new maintainer
Comment 28 Bin Li 2012-03-28 03:33:19 UTC
Anyway, it should be closed now.
Comment 29 Bernhard Wiedemann 2012-05-11 12:00:19 UTC
This is an autogenerated message for OBS integration:
This bug (749031) was mentioned in
https://build.opensuse.org/request/show/120703 Factory / pm-utils