このエントリーは、CentOS サーバー設定用 Chef Cookbook/Recipe の目次 の一部です。 Unicorn の init.d 起動スクリプト用の Chef Recipe アプリケーション(プロジェクト)ごとに、init.d 起動スクリプトを作成するために、プロジェクト名は変数(node.set[‘project’][‘name’])にしています。 site-cookbooks/base_cookbook/recipes/unicorn_app.rb unicorn_app_service = "unicorn_#{node.set['project']['name']}" template "/etc/init.d/#{unicorn_app_service}" do source "unicorn_app.erb" owner 'root' group 'root'
![Unicorn プロセスを自動起動させる init.d スクリプト用の Chef Recipe](https://cdn-ak-scissors.b.st-hatena.com/image/square/b27ba1d703068fc4853ea1271440cbb779e7cabb/height=288;version=1;width=512/https%3A%2F%2Feasyramble.com%2Fwp-content%2Fuploads%2F2016%2F03%2Feasyramble_ogp.jpg)