Working around really really a small but irritating nwam bug

The euphoria over having a laptop that would suspend to RAM did not last long before it was shattered by a more real world situation. That is suspending while the wireless is connected, ie not when at my desk. This is bug 6766807 which is somewhat irritating and I'm sure will be resolved soon. With my work hat on I wonder if this could be one of the bugs that will be fixed in a supported update. However there is a simple work around.

#!/bin/ksh

function restart_nwam
{
	pfexec svcadm restart nwam
}
trap restart_nwam 35

while :
do
	sleep $((60\*60\*24))
done

Run that script as one of the programs started by the session and this problem is history. Obviously keep an eye on the bug so that when the fix is delivered you remove the work around. I'll update the bug with the workaround on Monday.

Comments:

What about adding a "trap" which waits for the SIGTHAW/SIGFREEZE signals (which should be send to all processes when the OS is suspended/de-suspended ; I'm not sure whether ksh88 supports traps for these signals but ksh93 definately supports the signals) ?

Posted by Roland Mainz on November 30, 2008 at 07:41 PM GMT #

Trapping on SIGFREEZE doesn't help, as there is no guarantee that the signal will be delivered till after resume. So the only relevant signal is SIGTHAW. But if the problem is specifically on resume, trapping on SIGTHAW should work.

Posted by Randy on December 04, 2008 at 02:19 PM GMT #

@rowland

the script does trap on THAW but by number since there is abug where ksh93 does not understand THAW. See bug http://bugs.opensolaris.org/view_bug.do?bug_id=6778077

Posted by Chris Gerhard on December 04, 2008 at 02:23 PM GMT #

> the script does trap on THAW but by number since
> there is abug where ksh93 does not understand
> THAW. See bug #6778077

Grumpf... the ksh93-integration update2 will fix the problem... and we won't see this bugs again since I added a test module to ksh93's test suite to check whether the bug is fixed or not - see http://svn.genunix.org/repos/on/branches/ksh93/gisburn/scripts/tests/sun_solaris_cr_6778077_sigthaw_trap.sh

Posted by Roland Mainz on December 04, 2008 at 04:38 PM GMT #

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today