0
我的服務器中有兩個用戶:root
和development
。每當Sphinx重新啓動時,searchd.production.pid
的所有權總是更改爲root
。不過,我總是使用development
來完成任何上限,更新代碼等。在Sphinx重啓後自動將searchd.production.pid所有權更改爲所需所有者
我有這個在我的deploy.rb
:
after "deploy:update_code", "sphinx:stop"
after "deploy:migrate", "sphinx:start"
namespace :sphinx do
desc "Start Sphinx Searchd"
task :start, :roles => :app do
run "cd #{deploy_to}/current/; /usr/bin/rake ts:start RAILS_ENV=#{rails_env}"
end
desc "Stop Sphinx Searchd"
task :stop, :roles => :app do
run "cd #{deploy_to}/current/; /usr/bin/rake ts:stop RAILS_ENV=#{rails_env}"
end
desc "Restart Sphinx Searchd"
task :restart, :roles => :app do
run "cd #{deploy_to}/current/; /usr/bin/rake ts:restart RAILS_ENV=#{rails_env}"
end
end
但隨後這是使用development
用戶運行,我只能更改文件的所有權,如果我是老闆。任何想法?謝謝!