1

I'm trying to provision a development box with Vagrant and a CentOS 6.5 base box. I want memcached to automatically start at system boot/vagrant up.

I have tried adding memcached -d -l localhost -p11211 to /etc/rc.d/rc.local and this does not work.

I have also tried adding to /etc/init/vagrant-mounted.conf

start on vagrant-mounted
memcached -d -l localhost -p11211

[EDIT]

I've updated /etc/rc.d/rc.local to now use the following

chkconfig memcached on
service memcached start

I'm not seeing anything in the /var/log/boot.log. It looks like rc.local is not being run at all. It has ugo+x permissions; so the file is definitely executable, but it doesn't appear to run at all.

bigtunacan
  • 4,873
  • 8
  • 40
  • 73
  • Similar questions and more info here: http://serverfault.com/questions/201981/launch-memcached-on-server-boot – Bing Feb 25 '16 at 09:06

1 Answers1

0

Does memcached -d -l localhost -p11211 exit immediately or spawn a process?

If it keeps running, try: nohup memcached -d -l localhost -p11211 &

Also, try putting it in /etc/rc.local as memcached -d -l localhost -p11211 >/var/log/memcached.log 2>&1

That will give you a log file with possible errors. Lastly, does your install of memcached not have an init.d file in /etc/init.d ? if it does, simply do chkconfig servicename on && service servicename start

Marc Young
  • 3,854
  • 3
  • 18
  • 22
  • From the terminal it starts up find as a process and runs in the background without needing `&` at the end. Neither of these settings in the rc.local started either. Sending output to /var/log/memcached.log isn't even creating a log file. I checked permissions and rc.local is executable. If I run it after being logged in it starts fine, but it doesn't start a boot. – bigtunacan Aug 17 '15 at 19:52