SASS --watch を Chef Cookbook からデーモンとして起動するためのガイダンスを期待していました。以下はうまくいかないようです:
lib="/vagrant/lib"
sassPath="#{lib}/sass"
include_recipe 'ruby'
execute 'install-sass' do
command 'gem install sass'
end
execute "mkdir-lib" do
not_if {File.exists?(lib)}
command "mkdir #{lib}"
end
execute "mkdir-sass" do
not_if {File.exists?(sassPath)}
command "mkdir #{sassPath}"
end
execute "create-procfile" do
command "nohup sass --watch #{sassPath}:#{lib} &"
end
Chef は正常に完了します。sass --watch をサービスとして実行する方法はないようです。
シェフからの出力:
[default] Running chef-solo...
stdin: is not a tty
[2012-12-19T19:39:44+00:00] INFO: *** Chef 10.14.2 ***
[2012-12-19T19:39:27+00:00] INFO: Setting the run_list to ["recipe[ruby]", "recipe[sass]"] from JSON
[2012-12-19T19:39:27+00:00] INFO: Run List is [recipe[ruby], recipe[sass]]
[2012-12-19T19:39:27+00:00] INFO: Run List expands to [ruby, sass]
[2012-12-19T19:39:27+00:00] INFO: Starting Chef Run for precise64
[2012-12-19T19:39:27+00:00] INFO: Running start handlers
[2012-12-19T19:39:27+00:00] INFO: Start handlers complete.
[2012-12-19T19:39:27+00:00] INFO: Processing execute[apt-update] action run (ruby::default line 1)
[2012-12-19T19:39:40+00:00] INFO: execute[apt-update] ran successfully
[2012-12-19T19:39:40+00:00] INFO: Processing package[ruby] action install (ruby::default line 5)
[2012-12-19T19:39:57+00:00] INFO: Processing execute[install-sass] action run (sass::default line 6)
[2012-12-19T19:40:54+00:00] INFO: execute[install-sass] ran successfully
[2012-12-19T19:40:54+00:00] INFO: Processing execute[mkdir-lib] action run (sass::default line 10)
[2012-12-19T19:40:54+00:00] INFO: Processing execute[mkdir-sass] action run (sass::default line 15)
[2012-12-19T19:40:54+00:00] INFO: Processing execute[create-procfile] action run (sass::default line 20)
[2012-12-19T19:40:54+00:00] INFO: execute[create-procfile] ran successfully
[2012-12-19T19:40:54+00:00] INFO: Chef Run complete in 87.021831 seconds
[2012-12-19T19:40:54+00:00] INFO: Running report handlers
[2012-12-19T19:40:54+00:00] INFO: Report handlers complete