Forum: Ruby on Rails Automating memcached startup for my app.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2007-06-22 19:35

My app. requires memcached, and I'd like to build any necessary
restarting of the memcached daemon into my site startup.  (I already
have my script executing as part of a deploy, but I'd like to
"bulletproof" it more if possible).

I wrote a script which will restart memcached if it isn't there.

My problem is I need to reliably invoke it whenever my production site
is started.

I'm using Apache with FCGI (and yes, I will be migrating to Mongrel
soon).  I attempted to use production.rb/environment.rb to handle this,
but I couldn't get the system calls to work, and anyway, I don't really
want multiple Ruby processes (either FCGI or Mongrel) competing to start
the memcached daemon anyway.

So I'd really like to hook the startup script I wrote into the startup
process for Apache.  Is there a natural hook for this that Apache
provides where I can issue arbitrary commands as part of starting up the
httpd daemon?  Or do I need to customize the apachectl script or
something equally invasive?

This topic is locked and can not be replied to.