Now that memcached 1.4.4 is out, I thought it would be nice to update it:
123456789101112131415
curl -O http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar xzvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure
make
make verify
sudo make install
curl -O http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
tar xzvf memcached-1.4.4.tar.gz
cd memcached-1.4.4
./configure
make
make testsudo make install
1234567891011121314151617181920
#!/usr/bin/env rubyrequire'pathname'# memcached requires an absolute path for the -P switchroot=(Pathname.new(__FILE__).dirname+'..').realpathpidfile=root+'tmp'+'memcached.pid'ifnotpidfile.exist?puts"memcached not running: starting"system'memcached','-d','-P',pidfile,'-l','127.0.0.1'elseputs"memcached running: stopping"pid=pidfile.read.chompsystem'kill',pid# it appears that memcached doesn't clean up its pid file# unless you send it a QUIT signal (TERM, KILL, HUP don't)# unfortuantely, QUIT on Mac OS X causes memcached to crashpidfile.deleteend