launchd gives me " No such file or directory" error

Radek

my .plist looks like below ... In /var/log.system.log I can see

(com.example.exampled[24728]): posix_spawn("/usr/local/bin/ruby /Users/radek/Sites/sinatrasvn/web.rb", ...): No such file or directory
(com.example.exampled[24728]): Exited with exit code: 1
(com.example.exampled): Throttling respawn: Will start in 10 seconds

but if I run /usr/local/bin/ruby /Users/radek/Sites/sinatrasvn/web.rb the script works fine. Any idea?

       <?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.example.exampled</string>
    <key>ProgramArguments</key>
    <array>
                 <string>/usr/local/bin/ruby /Users/radek/Sites/sinatrasvn/web.rb</string>
    </array>
    <key>KeepAlive</key>
    <true/>
       </dict>
       </plist>
geekosaur

launchd doesn't use the shell to run programs; it uses the exec system call. This is why the plist you have above uses an array.

You are setting a single element of that array to a string containing a space, which leads launchd to attempt to exec("/usr/local/bin/ruby /Users/radek/Sites/sinatrasvn/web.rb") — which, sure enough, is not the name of a file. Instead, you want to set the array:

    <array>
                 <string>/usr/local/bin/ruby</string>
                 <string>/Users/radek/Sites/sinatrasvn/web.rb</string>
    </array>

This will pass the paths as individual arguments to exec(), and the right thing will happen.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

QSerialPort gives error "no such file or directory"

From Dev

Trying to push my app to heroku gives me this error FileNotFoundError: [Errno 2] No such file or directory: '/app/gettingstarted/media'

From Dev

Docker exec printf gives No such file or directory error

From Dev

When I run node app.js command it gives me error ` ENOENT, no such file or directory on .mime.types

From Dev

When I run node app.js command it gives me error ` ENOENT, no such file or directory on .mime.types

From Dev

podman run with --init gives me: Error: container-init binary not found on the host: stat /usr/libexec/podman/catatonit: no such file or directory

From Dev

Makefile is giving me an error - No such file or directory

From Java

running pod set up gives me "bad interpreter: No such file or directory"

From Dev

Write to a file on docker container gives error: No such file or directory

From Dev

Concatenating files from a directory using cat gives "No such file or directory" error

From Dev

$ find -exec cd => gives error: => find: ‘cd’: No such file or directory

From Dev

hadoop version command gives error related to java (No such file or directory)

From Dev

Write to a file on docker container gives error: No such file or directory

From Dev

scp gives "[file] not a directory" error when using parameters

From Dev

Concatenating files from a directory using cat gives "No such file or directory" error

From Dev

MySQL 'AND' gives me error

From Dev

It gives me an error at GPS

From Dev

xargs give me error cannot open `{}' (No such file or directory)

From Dev

Python script gives `: No such file or directory`

From Dev

SCP gives File or directory not found

From Dev

ADB echo gives "No such file or directory"

From Dev

Python script : gives no such file or directory

From Dev

ls *.* gives: "*.*: No such file or directory" message

From Dev

ADB echo gives "No such file or directory"

From Dev

Animate UITableViewCell gives me error

From Dev

Sorting array gives me error

From Dev

php header gives me the error

From Dev

.getDownloadUrl() gives me error - Android

From Dev

using "this" in a fragment gives me an error

Related Related

  1. 1

    QSerialPort gives error "no such file or directory"

  2. 2

    Trying to push my app to heroku gives me this error FileNotFoundError: [Errno 2] No such file or directory: '/app/gettingstarted/media'

  3. 3

    Docker exec printf gives No such file or directory error

  4. 4

    When I run node app.js command it gives me error ` ENOENT, no such file or directory on .mime.types

  5. 5

    When I run node app.js command it gives me error ` ENOENT, no such file or directory on .mime.types

  6. 6

    podman run with --init gives me: Error: container-init binary not found on the host: stat /usr/libexec/podman/catatonit: no such file or directory

  7. 7

    Makefile is giving me an error - No such file or directory

  8. 8

    running pod set up gives me "bad interpreter: No such file or directory"

  9. 9

    Write to a file on docker container gives error: No such file or directory

  10. 10

    Concatenating files from a directory using cat gives "No such file or directory" error

  11. 11

    $ find -exec cd => gives error: => find: ‘cd’: No such file or directory

  12. 12

    hadoop version command gives error related to java (No such file or directory)

  13. 13

    Write to a file on docker container gives error: No such file or directory

  14. 14

    scp gives "[file] not a directory" error when using parameters

  15. 15

    Concatenating files from a directory using cat gives "No such file or directory" error

  16. 16

    MySQL 'AND' gives me error

  17. 17

    It gives me an error at GPS

  18. 18

    xargs give me error cannot open `{}' (No such file or directory)

  19. 19

    Python script gives `: No such file or directory`

  20. 20

    SCP gives File or directory not found

  21. 21

    ADB echo gives "No such file or directory"

  22. 22

    Python script : gives no such file or directory

  23. 23

    ls *.* gives: "*.*: No such file or directory" message

  24. 24

    ADB echo gives "No such file or directory"

  25. 25

    Animate UITableViewCell gives me error

  26. 26

    Sorting array gives me error

  27. 27

    php header gives me the error

  28. 28

    .getDownloadUrl() gives me error - Android

  29. 29

    using "this" in a fragment gives me an error

HotTag

Archive