beanstalked 后台运行

安装好beanstalked后执行命令

clipboard.png
一直卡在这里,怎么能把shell断开连接后后台运行呢

阅读 3.6k
2 个回答

nohup & 可以后台运行,不知道符不符合你的要求。

nohup beanstalkd -l 0.0.0.0 -p39100 -F & 

查看下对应进程是否在后台运行着

ps -aux |grep beanstalkd

centos7以上这样最好这样,写入文件 beanstalkd.service

[Unit]
Description=beanstalkd

[Service]
WorkingDirectory=/tmp
#命令要绝对路径,whereis beanstalkd 查看
ExecStart=/usr/bin/beanstalkd -l 0.0.0.0 -p39100 -F
TimeoutStopSec=3s
Restart=always

[Install]
WantedBy=multi-user.target

然后 systemctl enable $(pwd)/beanstalkd.service && systemctl start beanstalkd

其他相关命令:

#查看状态
systemctl status beanstalkd
#手动停止
systemctl stop beanstalkd
#重启
systemctl restart beanstalkd

楼上那种方法当异常崩溃时,不会重启

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题