Capistrano는 Redis-Server를 성공적으로 시작하지만 로그인 할 때 실행되지 않습니다.

StackOverflow https://stackoverflow.com//questions/12715874

  •  13-12-2019
  •  | 
  •  

문제

RedIS 서버를 제어 할 수있는 Capistrane 스크립트가 있습니다.질문의 작업은 다음과 같습니다.

  %w[start stop restart].each do |cmd|
    desc "#{cmd}s redis-server"
    task cmd, :roles => :app do
      run "#{sudo} /etc/init.d/redis-server #{cmd}"
    end
  end

When I run this (deploying to a local vagrant VM) it says it's starts successfully:

    > cap local redis:start


    triggering load callbacks
  * executing `local'
Deploying branch master
    triggering start callbacks for `redis:start'
  * executing `multistage:ensure'
  * executing `redis:start'
  * executing "sudo -p 'sudo password: ' /etc/init.d/redis-server start"
    servers: ["192.168.33.10"]
Password: 
    [192.168.33.10] executing command
 ** [out :: 192.168.33.10] Starting redis-server:
 ** [out :: 192.168.33.10] redis-server.
    command finished in 2054ms
.

그러나 Redis-Server가 SSH에서 실행될 때 실행되지 않습니다. 수동으로 시작하면 작동합니다.

> sudo /etc/init.d/redis-server start
.

와 나는 위와 동일한 출력을 얻을 수 있습니다.이 시간만이 프로세스가 실행 중입니다.

/var/log/redis/redis.log에서 로그를보고 파일이 비어 있습니다.

아이디어가 무엇을 잘못하고 있습니까?나는이 (nginx, unicorn, mysql 등)와 같은 다른 서비스를 시작하고 그것들은 잘 작동하고 있습니다.

도움이 되었습니까?

해결책

SSH 연결이 종료되면 Redis 프로세스가 끝나고 있습니다.

스크립트에 nohup 을 추가하십시오 :

run "#{sudo} nohup /etc/init.d/redis-server #{cmd}"
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top