Home Forums Software InstaDMG Only three out of four Launch Daemons run

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #379083
    jasonkstupski
    Participant

    Hey 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,
    Jason

    #379088
    jasonkstupski
    Participant

    Hey all,

    Here’s my plist and shell script file. Any help would be so appreciated!!

    [code]

    Disabled

    Label
    com.stupski.ActivateMCX
    ProgramArguments

    /Applications/Utilities/Scripts/ActivateMCX.sh

    RunAtLoad
    [/code]

    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!!
    Jason

    #379089
    Rusty Myers
    Participant

    I have all my launchd items call a script with a shell:
    Does that help?
    [code]

    Disabled

    Label
    com.stupski.ActivateMCX
    ProgramArguments

    /bin/bash
    /Applications/Utilities/Scripts/ActivateMCX.sh

    RunAtLoad
    [/code]

    [QUOTE][u]Quote by: jasonkstupski[/u][p]Hey all,

    Here’s my plist and shell script file. Any help would be so appreciated!!

    [code]

    Disabled

    Label
    com.stupski.ActivateMCX
    ProgramArguments

    /Applications/Utilities/Scripts/ActivateMCX.sh

    RunAtLoad
    [/code]
    [/QUOTE]

    #379090
    jasonkstupski
    Participant

    Thanks 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,
    Jason

    #379091
    jasonkstupski
    Participant

    Okay, 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,
    Jason

    #379093
    jasonkstupski
    Participant

    I’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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Comments are closed