AWG Blogs

Sunday, September 20, 2009

Getting memcached to Run at Startup on Ubuntu

For some reason memcached would start and then die shortly after on reboot. This is on an Ubuntu 8.04 with updated packages for Apache2, PHP5, and memcached installed through apt-get.

The only way I could fix the problem was to remove memcached from the rc scripts:

update-rc.d -f memcached remove


Then add the following line to /etc/rc.local:

/usr/bin/memcached -d -p 11211 -u nobody -l 127.0.0.1 -m 64


I'm sure this will have to be adjusted if I ever need more memcached processes or if I need the PID file. Speaking of which, I suspect that the canned scripts that came with this memcached 3.0.1 from Ubuntu are too convoluted with regard to the PIDs, which already have problems of their own.

This bug report set me in the right direction.

1 comment: