daemondo / launchd just being silly on me

dreamcat four dreamcat4 at gmail.com
Sun Nov 8 11:39:55 PST 2009


Hi,

I've got the following:

$ gem install stompserver

Portfile:
startupitem.create		yes
startupitem.name		rb-stompserver
startupitem.logevents	yes
startupitem.logfile		/var/log/stompserver.log
startupitem.pidfile		auto /var/log/stompserver.pid

# startupitem.executable  "ruby
${prefix}/lib/ruby/gems/1.8/bin/stompserver --working_dir=/var"
# startupitem.executable  "/opt/local/bin/ruby
${prefix}/lib/ruby/gems/1.8/bin/stompserver --working_dir=/var"
# startupitem.executable  "/opt/local/bin/ruby
${prefix}/lib/ruby/gems/1.8/bin/stompserver --working_dir /var"
startupitem.executable  "${prefix}/lib/ruby/gems/1.8/bin/stompserver
--working_dir /var"

which creates the attached plist file. But for the life of me it just
won't start.

$ sudo port uninstall rb-stompserver && sudo port clean --dist
rb-stompserver && sudo port install stompserver
$ sudo port load rb-stompserver
$ cat /var/log/stompserver.log:

2009-11-08 19:22:39 rb-stompserver: Unable to launch process
/opt/local/lib/ruby/gems/1.8/bin/stompserver --working_dir /var.
2009-11-08 19:23:09 rb-stompserver: error while starting
2009-11-08 19:23:09 rb-stompserver: Starting process
2009-11-08 19:23:09 rb-stompserver: Unable to launch process
/opt/local/lib/ruby/gems/1.8/bin/stompserver --working_dir /var.
2009-11-08 19:23:39 rb-stompserver: error while starting
2009-11-08 19:23:39 rb-stompserver: Starting process
2009-11-08 19:23:39 rb-stompserver: Unable to launch process
/opt/local/lib/ruby/gems/1.8/bin/stompserver --working_dir /var.
2009-11-08 19:24:09 rb-stompserver: error while starting
2009-11-08 19:24:09 rb-stompserver: Starting process
2009-11-08 19:24:09 rb-stompserver: Unable to launch process
/opt/local/lib/ruby/gems/1.8/bin/stompserver --working_dir /var.

You get the picture.
Such error message corresponds to forking execvp() call in the Daemondo C code:

http://svn.macosforge.org/repository/macports/branches/images-and-archives/base/src/programs/daemondo/main.c

main.c, line 514:
pid_t
Exec(const char* const argv[], int sync)
{
    if (!argv || !argv[0] || !*argv[0])
        return -1;

    pid_t pid = fork();
    switch (pid)
    {
    case 0:
        // In the child process
        {
            // Child process has no stdin, but shares stdout and stderr with us
            // Is that the right behavior?
            int nullfd = 0;
            if ((nullfd = open("/dev/null", O_RDONLY)) == -1)
                _exit(1);
            dup2(nullfd, STDIN_FILENO);

            // Launch the child
            execvp(argv[0], (char* const*)argv); // <------------- xml
params are put here from the plist

            // We get here only if the exec fails.
            LogMessage("Unable to launch process %s.\n", argv[0]); //
<-----------  execvp() fails ???
            _exit(1);
        }
        break;


But it just doesn't make any sense to me. I can see no reason why the
ruby script should fall through and error out here. Have tried
prefixing with / without ruby binary eg 'ruby <script>'. Tried
swapping out the '=' param for a space. Made sure there were no quote
marks nor any other special shell manipulation. The same command of
course will run in a terminal. Nothing seems to change : (

Please help.


dreamcat4
dreamcat4 at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: org.macports.rb-stompserver.plist
Type: application/octet-stream
Size: 831 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20091108/785a4c74/attachment.obj>


More information about the macports-users mailing list