Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu: Running Memcached as daemon

I have installed memcached on Ubuntu. How can I run it as a daemon so that it runs in the background and I can use it in my rails application?

Thanks, Imran

like image 624
Saim Avatar asked Mar 23 '11 20:03

Saim


1 Answers

memcached is configured to run at boot by default, at least on 10.10:

# apt-get install memcached
...
Setting up memcached (1.4.5-1ubuntu1) ...
Starting memcached: memcached.
# ls -l /etc/rc*.d/*memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc0.d/K20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc1.d/K20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc2.d/S20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc3.d/S20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc4.d/S20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc5.d/S20memcached -> ../init.d/memcached
lrwxrwxrwx 1 root root 19 2011-03-23 13:36 /etc/rc6.d/K20memcached -> ../init.d/memcached
#  

In runlevels 2, 3, 4, and 5, memcached will be running.

If you're not sure, you can run the initscript with status:

# /etc/init.d/memcached status
 * memcached is running
like image 149
sarnold Avatar answered Oct 13 '22 11:10

sarnold