10.4: Avoid kernel panics with the Contivity VPN Client

Oct 26, '05 05:40:00AM

Contributed by: sgasp

Tiger only hintThe Contivity VPN client (version 3.3) is causing a kernel panic when you want to stop it. As it is stops when you shut down or restart the computer, it means that sometimes your computer will go into a kernel panic instead of restarting or powering off. This was almost systematic before 10.4.2. However, I'm used to stopping the VPN client when unused, and since I upgraded to 10.4, I can't do it anymore.

The kernel panics happens when unloading the Contivity kernel extension, or sometimes after doing any non-realated action with Contivity). So the workaround is to remove the command that unloads the Contivity kernel extension. I have not really found any drawback to this. And since I have done this, I can now stop and start the Contivity daemon using these commands:

 sudo /Library/StartupItems/Nleac/Nleac stop
 sudo /Library/StartupItems/Nleac/Nleac start
You'll need administrator privileges to make the change.

Here's how to do it:

  1. sudo cp /Library/StartupItems/Nleac/Nleac /Library/StartupItems/Nleac/Nleac.ori

  2. sudo chown /Library/StartupItems/Nleac/Nleac

  3. chmod +w /Library/StartupItems/Nleac/Nleac

  4. Open the Nleac script using your favorite editor, and look for the following code:
    # Stops the Netlock EAC.
    stop_km() {
      kmp=`ps -x | grep nleac | grep -v grep | awk '{ print $1 }'`
      inmp=`ps -x | grep inm | grep -v grep | awk '{ print $1 }'`
      kill -9 $kmp $inmp
    
      # Not sure this is needed or desired.
      unload_kext
    }
    
    Just comment out the unload_kext, as shown:
    # Stops the Netlock EAC.
    stop_km() {
      kmp=`ps -x | grep nleac | grep -v grep | awk '{ print $1 }'`
      inmp=`ps -x | grep inm | grep -v grep | awk '{ print $1 }'`
      kill -9 $kmp $inmp
    
      # Not sure this is needed or desired.
      #unload_kext
    }
    
    Personally, I have also removed the -9 option from the kill command, as I prefer to normally end processes whenever possible. All that's left is to restore ownership and rights...

  5. chmod -w /Library/StartupItems/Nleac/Nleac

  6. sudo chown root /Library/StartupItems/Nleac/Nleac
You are done, enjoy!

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051022044000366