centos - memcached 无法在 CentOS 6.5 的 vagrant up 上启动

标签 centos vagrant centos6.5

我正在尝试提供一个带有 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/

相关文章:

java - InetAddress.getLocalHost() 总是返回 127.0.0.1

command-line - 在 ssh 进入 VM 后继续/运行命令

ubuntu - 在 ubuntu 14.04 上安装 xdebug 不创建 xdebug.ini 文件

php - Linus(centos) + nginx "Warning: socket_bind() [function.socket-bind]: unable to bind address [98]: Address already in use in/home/chat/ws-api.php"

代码迁移到 CentOS 后的 c++ 共享库错误

module - Zabbix IBM MQM 可加载模块阻止 Zabbix Agent 服务

php - 从 CLI 调用时带有 PHPDocumentor 的无限循环(但通过 SSH 很好)

vagrant - Laravel Homestead 12.7 在 vagrant up 结束时抛出存储库错误

amazon-web-services - 从不同主机上的另一个容器通过 SSH 连接到 docker 容器

php - make 尝试在 Centos 6 上安装 mongo php 驱动程序失败