Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 05-08-2012, 11:02 PM   #1
Registered: Mar 2010
Posts: 52

Rep: Reputation: 3
resume scripts timing

I have a startup script that changes my MAC address for me, but I noticed that after a successful suspend/resume it was changed back. So I did some research and put together a resume script that changes it back. I put in in /etc/pm/sleep.d/99_changemac-suspend. It actually points back to the original script in /etc/init.d that does the MAC change on boot and outputs $1 to a file so I can see that it ran and with what input.

The script runs fine when I execute it manually and I can tell it runs on resume because the output file shows the expected input of "resume", but my MAC is not as it should be. I can only assume that even with a start order of 99 something else is running after it which reinitializes the NIC and loses my custom settings.

What can I do to troubleshoot this issue? Is there a way to force my script to run last?

{edit} I'm using 11.11

Last edited by shadowbox12; 05-08-2012 at 11:03 PM.
Old 05-09-2012, 03:51 PM   #2
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Why are you not using udev rules for this?

---------- Post added 05-09-12 at 01:52 PM ----------
Old 05-11-2012, 07:19 PM   #3
Registered: Mar 2010
Posts: 52

Original Poster
Rep: Reputation: 3
I got my hopes up on this, but looking at the rulesets ( I don't see one that allows you to specify a new MAC address the same way you can change the name. The best thing I could find was PROGRAM which allows you to run a program on a match.

So I made a rule like so:
# PCI device 0x8086:0x4222 (iwl3945)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:de:5b:6a:91", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2", PROGRAM=="/etc/init.d/changemac"

But it doesn't have the intended result of changing my mac. Any other ideas?


hibernate, resume, scripts, suspend

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripts to run after resume from sleep brixtoncalling Slackware 2 09-06-2009 03:27 PM
Suspend/Resume - custom scripts and mouse issues Arcalyth Linux - Laptop and Netbook 0 02-17-2009 05:30 PM
fedora core 5 boot, suspend, and resume scripts? dansawyer Fedora 1 08-23-2006 06:22 PM
how to start timing and print the timing result on portions of java codes ?? alred Programming 2 05-15-2006 10:00 AM
Suspend / Resume scripts on slackware 9 boney Slackware 0 06-19-2003 02:09 AM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration