0
我跟隨#335 Deploying to a VPS。在deploy.rb
,Capistrano:`run`和`sudo`的區別?
%w[start stop restart].each do |command|
desc "#{command} unicorn server"
task command, roles: :app, except: {no_release: true} do
run "/etc/init.d/unicorn_#{application} #{command}"
end
末
當我運行cap deploy:start
,我得到sh: /etc/init.d/unicorn_appname: Permission denied
。但是如果我改變運行到sudo:sudo "/etc/init.d/unicorn_#{application} #{command}"
,我得到sudo: /etc/init.d/unicorn_appname: command not found
。
那麼命令真的不存在,或者sudo
和run
彼此不同?