【问题标题】:memcached doesn't start on vagrant up with CentOS 6.5使用 CentOS 6.5 时,memcached 不会在 vagrant 上启动
【发布时间】:2015-08-17 13:40:43
【问题描述】:

我正在尝试使用 Vagrant 和 CentOS 6.5 基本框配置一个开发框。我希望 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 权限;所以该文件绝对是可执行的,但它似乎根本没有运行。

【问题讨论】:

标签: centos vagrant centos6.5


【解决方案1】:

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

【讨论】:

  • 从终端启动 find 作为进程并在后台运行,最后不需要&。 rc.local 中的这些设置都没有启动。将输出发送到 /var/log/memcached.log 甚至不会创建日志文件。我检查了权限并且 rc.local 是可执行的。如果我在登录后运行它,它会正常启动,但不会启动。
猜你喜欢
  • 2014-06-04
  • 2014-08-23
  • 2014-05-10
  • 2014-03-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-08
相关资源
最近更新 更多