Loading ...
Sorry, an error occurred while loading the content.

Detecting graceful restart

Expand Messages
  • Javier
    Hello, Does anyone know if it s possible to hook into Apache graceful restarts? I tried PerlRestartHandler, but it doesn t seem to get called. I see it called
    Message 1 of 3 , Jul 1, 2003
    • 0 Attachment
      Hello,

      Does anyone know if it's possible to hook into Apache
      graceful restarts?

      I tried PerlRestartHandler, but it doesn't seem to get
      called. I see it called when I do apachectl startssl,
      but not apachectl restart nor apachectl graceful.

      None of the documentation I've found mentions wheter
      it gets called only for plain restarts or for graceful
      restarts also.

      Thanks!

      __________________________________
      Do you Yahoo!?
      SBC Yahoo! DSL - Now only $29.95 per month!
      http://sbc.yahoo.com
    • Javier Alvarado
      Never mind. It was a mistake on my part. I was setting it with push_handler() in my startup.pl, so of course it didn t persist. Once I switched to setting it
      Message 2 of 3 , Jul 1, 2003
      • 0 Attachment
        Never mind. It was a mistake on my part. I was setting it with
        push_handler() in my startup.pl, so of course it didn't persist. Once I
        switched to setting it in the httpd.conf it was called on every restart,
        graceful or not.

        Now I'm having a different problem. In my restart handler I print out
        the PID using a simple 'warn "pid = $$\n". I was expecting it would
        print out the PID of the parent (listener) Apache process, but the PID
        that is printed does not exist in the process table, and is in fact the
        real Apache parent PID - 1. Getting the PID with POSIX::getpid produces
        the same result.

        I'm baffled by this. Can anyone shed any light?

        Javier wrote:

        > Hello,
        >
        > Does anyone know if it's possible to hook into Apache
        > graceful restarts?
        >
        > I tried PerlRestartHandler, but it doesn't seem to get
        > called. I see it called when I do apachectl startssl,
        > but not apachectl restart nor apachectl graceful.
        >
        > None of the documentation I've found mentions wheter
        > it gets called only for plain restarts or for graceful
        > restarts also.
        >
        > Thanks!
        >
        > __________________________________
        > Do you Yahoo!?
        > SBC Yahoo! DSL - Now only $29.95 per month!
        > http://sbc.yahoo.com
      • Bruno Connelly
        Javier Now I m having a different problem. In my restart handler I Javier print out the PID using a simple warn pid = $$ n . I was Javier expecting it
        Message 3 of 3 , Jul 1, 2003
        • 0 Attachment
          Javier> Now I'm having a different problem. In my restart handler I
          Javier> print out the PID using a simple 'warn "pid = $$\n". I was
          Javier> expecting it would print out the PID of the parent
          Javier> (listener) Apache process
          [...]

          Sounds like you want getppid() instead.

          b.
          --
          /* Bruno Connelly, <bruno@...> */
        Your message has been successfully submitted and would be delivered to recipients shortly.