launchd and plist trouble

Discussion in 'Mac Programming' started by Poeben, Jul 12, 2007.

  1. macrumors 6502

    Joined:
    Jul 29, 2004
    #1
    I wrote a simple shell script to mount a few afp volumes during startup. The script works fine when run manually from terminal. Problem is I can't get the plist to load using 'launchctl' It does not show up in the 'list' and I get the 'Bonjour Workaround' error. I want this to execute when the user logs in. Here's the code (plist path ~/Library/LaunchAgents/)

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>Label</key>
            <string>Shop Mounter v0.3</string>
            <key>OnDemand</key>
            <false/>
            <key>Program</key>
            <string>/Users/shop/usr/local/bin/mount_shop.sh</string>
            <key>ProgramArguments</key>
            <array>
                    <string>/Users/shop/usr/local/bin/mount_shop.sh</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
            <key>ServiceDescription</key>
            <string>Version 0.3 attempt</string>
    </dict>
    </plist>
    
    Thanks for any help
     
  2. macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #2
    If I remember correctly, the .plist file has to be owned by root with group admin.

    Anyway, that's the way I have one I created set and it works (on the other hand, mine is a daemon in /Library/LaunchDaemons. It makes less sense why a user agent would have to be owned in this way... Well, actually, since this is in the global /Library folder rather than a user specific one, I guess it does make sense.
     

Share This Page