Issue with RootDirectory key in launchd plist file

  • Hi All ,

    I'm facing a problem with RootDirectory key in launchd plist file.
    It's working fine on PPC , but giving exceptions on Intel Mac .

    Here is the exception that I'm getting on intel mac.

    12:37 PM
    Sep 24 11:17:31  launchd[15822]: com.apple.TestLaunchd: execve(): No
    such file or directory
    Sep 24 11:17:31  launchd[15823]: com.apple.TestLaunchd: execvp
    ("TestLaunchd", ...): No such file or directory

    Below is the plist file.

    <?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>com.apple.TestLaunchd</string>
    <key>OnDemand</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
      <string>TestLaunchd</string>
    </array>
          <key>RootDirectory</key>
    <string>~/</string>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>30</integer>
    </dict>
    </plist>

    Removing the RootDirectory key and giving the complete path in the
    ProgramArguments key is working fine.

    can anyone help me out in this issue ...

    Thanks in Advance
    Sudheer.
  • On 24 Sep 07, at 00:15, Sudheer dantuluri wrote:
    > Hi All ,
    >
    > I'm facing a problem with RootDirectory key in launchd plist file.
    > It's working fine on PPC , but giving exceptions on Intel Mac .
    <...>
    > <key>RootDirectory</key>
    > <string>~/</string>

    ~ is not a path - it's a shortcut for the current user's home
    directory that gets expanded by the shell. There's no actual
    directory called "~", though, and I suspect that  launchd may not be
    able to perform the tilde  expansion reliably. Try specifing the full
    path to the appropriate user's home directory.

    I don't know why this would differ between PPC and x86 Mac OS, but I
    don't see any reason it couldn't either.
  • Hi Andrew Farmer ,

    I actually want to launch an application that is installed for a
    specific user.
    Specifying the complete path restricts to only one user.
    What if i want to launch the same application that is installed in
    another user by placing the same plist file in that user's Library/
    LaunchAgents folder ?
    Do i need to change the path explicitly or is there any other way ...

    The documentation of RootDirectory is as follows.
    RootDirectory <string>
          This optional key is used to specific a directory to chroot(2)
    to before
          running the job.

    Even if i specify the value as /Users/sudheer/ to RootDirectory ,
    it's not working on Intel Mac.

    Thanks
    Sudheer.

    On 24 Sep 07, at 00:15, Sudheer dantuluri wrote:
    > Hi All ,
    >
    > I'm facing a problem with RootDirectory key in launchd plist file.
    > It's working fine on PPC , but giving exceptions on Intel Mac .

    <...>
    > <key>RootDirectory</key>
    > <string>~/</string>

    ~ is not a path - it's a shortcut for the current user's home
    directory that gets expanded by the shell. There's no actual
    directory called "~", though, and I suspect that  launchd may not be
    able to perform the tilde  expansion reliably. Try specifing the full
    path to the appropriate user's home directory.

    I don't know why this would differ between PPC and x86 Mac OS, but I
    don't see any reason it couldn't either.
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today