- This topic has 5 replies, 2 voices, and was last updated 14 years, 9 months ago by
jasonkstupski.
-
AuthorPosts
-
July 13, 2010 at 11:27 pm #379083
jasonkstupski
ParticipantHey there,
I’m building a Snow Leopard image, and putting in a few LaunchDaemons to run scripts at startup:
1. Activate ARD for a particular administrative user.
2. Activate SSH.
3. Add our workgroup printers.
4. Run the local MCX startup script to check for the MAC address and append it into the right file in /private/var/db/dslocal/nodes/Default/computers/For some reason, only the last one doesn’t run. I’m stumped. The permissions are the same on all four, all four have scripts residing in the same place with the same permissions. Even when I run the last one using launchctl, it works fine. But it just won’t kick off at startup. Is there something else I need to check? This is driving me bonkers!
I’ve had the same local MCX Launch Daemon running just fine on my Leopard builds. Maybe there’s something different with Snow?
Any suggestions or pointers would be most appreciated.
Thanks,
JasonJuly 14, 2010 at 3:53 pm #379088jasonkstupski
ParticipantHey all,
Here’s my plist and shell script file. Any help would be so appreciated!!
[code]
[/code]
Disabled
Label
com.stupski.ActivateMCX
ProgramArguments
/Applications/Utilities/Scripts/ActivateMCX.sh
RunAtLoad
Here are the permissions on that file:
[code]-rw-r–r–@ 1 root wheel 423 Jul 14 08:50 ActivateMCX.plist[/code]
And here’s the shell script. I even mega-simplified it from my original one:
[code]#!/bin/sh
MAC=`ifconfig en0 | awk ‘ /ether/ {print $2}’`
dscl . -delete /Computers/local_laptop ENetAddress
dscl . -create /Computers/local_laptop ENetAddress $MAC
[/code]And the permissions on that file:
[code]-rwxr-xr-x@ 1 root wheel 164 Jul 13 17:27 ActivateMCX.sh[/code]
Thanks!!
JasonJuly 14, 2010 at 4:00 pm #379089Rusty Myers
ParticipantI have all my launchd items call a script with a shell:
Does that help?
[code]
[/code]
Disabled
Label
com.stupski.ActivateMCX
ProgramArguments
/bin/bash
/Applications/Utilities/Scripts/ActivateMCX.sh
RunAtLoad
[QUOTE][u]Quote by: jasonkstupski[/u][p]Hey all,
Here’s my plist and shell script file. Any help would be so appreciated!!
[code]
[/code]
Disabled
Label
com.stupski.ActivateMCX
ProgramArguments
/Applications/Utilities/Scripts/ActivateMCX.sh
RunAtLoad
[/QUOTE]July 14, 2010 at 4:41 pm #379090jasonkstupski
ParticipantThanks Rusty.
No change here. I now see that it must be doing something – when I run dscl . read /Computers/local_laptop, it now populates ENetAddress with a blank field. Not sure what’s going on there. Perhaps my script is busted?
Strangely enough, if I run the script by itself, it populates it correctly. Then, when I restart, it wipes ENetAddress out every time. Testing now by taking out the “delete” line. Totally confused..
Thanks,
JasonJuly 14, 2010 at 4:44 pm #379091jasonkstupski
ParticipantOkay, took out the delete line, but it’s still making the field blank. Not sure what could be causing this – is it that at startup, the command
MAC=`ifconfig en0 | awk ‘ /ether/ {print $2}’`
is pulling back a blank address?
Thanks,
JasonJuly 14, 2010 at 5:28 pm #379093jasonkstupski
ParticipantI’ve got it.
I needed to run this line:
/usr/sbin/networksetup -detectnewhardware # just to make sure that it is done
As shown in this post: https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=23782
Thanks!
Jason -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed