The script starts the server fine (According to the output of apachectl anyway) but it appears that the server is immediately dispatched. I just get a defunct apachectl process.

I've not used expect before, but I do know that apachectl isn't supposed to hang around after starting apache; it should exit in good order. That would suggest to me an apache/ssl startup problem.

I just glanced at the expect FAQ, which has this:

Q: How come when I automate the passwd program to change passwords for me passwd dies before changing the password sometimes/every time? A: What's happening is you are closing the handle before passwd exits. When you close the handle to a process it is sent a signal (SIGPIPE?) telling it that STDOUT has gone away. The default behavior for processes is to die in this circumstance. Two ways you can make this not happen are: $process->soft_close(); Which is new in 1.04. This will wait 15 seconds for a process to finish up before killing it. $process->expect(undef); This will wait forever for the process to match an empty set of patterns. It will return when the process hits an EOF.
Is it possible your sleep isn't long enough for apachectl to return? You might see what happens with
$process->expect(0)

___ -DA > perl -MPOSIX -le '$ENV{TZ}="EST";print ctime(1000000000)' Sat Sep 8 20:46:40 2001

In reply to Re: Trouble starting Daemon with Expect.pm by da
in thread Trouble starting Daemon with Expect.pm by shotgunefx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.