gpt4 book ai didi

Ubuntu:将 Memcached 作为守护进程运行

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:26 26 4
gpt4 key购买 nike

我已经在 Ubuntu 上安装了 memcached。我怎样才能将它作为守护进程运行,以便它在后台运行并且我可以在我的 Rails 应用程序中使用它?

最佳答案

memcached 默认配置为在启动时运行,至少在 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
#

在运行级别 2、3、4 和 5 中,memcached 将运行。

如果您不确定,可以使用status 运行初始化脚本:

# /etc/init.d/memcached status
* memcached is running

关于Ubuntu:将 Memcached 作为守护进程运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5411289/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com