running startup scripts at server startup?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • T Stoneman

    running startup scripts at server startup?

    I was wondering if PHP has some type of initialization functionality
    at startup where I can run a script when the web server first boots
    up?

    I have an Apache server running PHP, and I would like whenever my web
    server restarts to clean up some tables that have temporary
    information in it.

    I have searched through my PHP books and tried Googling, but as you
    can imagine, most hits are about the apachectl startup script which is
    not what I'm looking for.

    Any help would be greatly appreciated!

    Thanks,

    Terry
  • CountScubula

    #2
    Re: running startup scripts at server startup?

    it would be best to put a link to your script in /etc/crond.daily/ rather
    than when your server restarts, really how often does your server restart,
    min restart about once every year.

    --
    Mike Bradley
    http://www.gzentools.com -- free online php tools
    "T Stoneman" <tstoneman4@hot mail.com> wrote in message
    news:23ded962.0 401291054.17c8b f3a@posting.goo gle.com...[color=blue]
    > I was wondering if PHP has some type of initialization functionality
    > at startup where I can run a script when the web server first boots
    > up?
    >
    > I have an Apache server running PHP, and I would like whenever my web
    > server restarts to clean up some tables that have temporary
    > information in it.
    >
    > I have searched through my PHP books and tried Googling, but as you
    > can imagine, most hits are about the apachectl startup script which is
    > not what I'm looking for.
    >
    > Any help would be greatly appreciated!
    >
    > Thanks,
    >
    > Terry[/color]


    Comment

    • Tim Van Wassenhove

      #3
      Re: running startup scripts at server startup?

      On 2004-01-29, T Stoneman <tstoneman4@hot mail.com> wrote:[color=blue]
      > I have an Apache server running PHP, and I would like whenever my web
      > server restarts to clean up some tables that have temporary
      > information in it.[/color]

      I'm using debian overhere, so all my startup scripts are in /etc/rcX.d/
      (with X the runlevel). Actually those directories only containt symlinks
      to /etc/init.d/scripts

      So if i wanted something that is being called when apache is started,
      i'd edit /etc/init.d/apache and add a call to the script in the start
      section.

      But that requires that nobody is using apachectl directly.

      --

      Comment

      Working...