我正在開發Rails v2.3.2應用程序。在Ubuntu機器上。現在命令停止和啓動nginx
,我想有兩個耙任務停止和開始 * Nginx的 *分別是什麼是這個命令?
task :start_nginx do
puts "stop Nginx..."
system '...' #What is the command to stop Nginx?
end
task :stop_nginx do
puts "stop Nginx..."
system '...' #What is the command to start Nginx?
end
爲什麼你有兩個啓動和停止?他們都需要運行嗎?或者任何一個都沒問題? – Mellon
取決於你的系統,例如debian使用'/ etc/init.d',但arch使用'/ etc/rc.d' –