我正在尝试提供一个带有 Vagrant 和 CentOS 6.5 base box 的开发箱。我希望 memcached 在系统启动/vagrant up 时自动启动。
我已经尝试将 memcached -d -l localhost -p11211
添加到/etc/rc.d/rc.local,但这不起作用。
我也尝试添加到/etc/init/vagrant-mounted.conf
start on vagrant-mounted
memcached -d -l localhost -p11211
[编辑]
我已经更新了 /etc/rc.d/rc.local
现在使用以下内容
chkconfig memcached on
service memcached start
我在/var/log/boot.log 中没有看到任何内容。看起来 rc.local 根本没有运行。它有 ugo+x 权限;所以该文件肯定是可执行的,但它似乎根本没有运行。
最佳答案
memcached -d -l localhost -p11211 是立即退出还是产生一个进程?
如果一直运行,试试:nohup memcached -d -l localhost -p11211 &
此外,尝试将它放在/etc/rc.local 中 memcached -d -l localhost -p11211 >/var/log/memcached.log 2>&1
这将为您提供一个包含可能错误的日志文件。 最后,您安装的 memcached 在/etc/init.d 中没有 init.d 文件吗? 如果是,只需在 && service servicename start 上执行 chkconfig servicename
关于centos - memcached 无法在 CentOS 6.5 的 vagrant up 上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32051948/