# chef-client - Chef Configuration Management Client
#
# Chef Client provides the Chef configuration management daemon

description "Chef Client"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

respawn
respawn limit 5 30

pre-start script
    test -x <%= @client_bin %> || { stop; exit 0; }
end script

script
    if [ -r /etc/default/locale ]; then
        . /etc/default/locale
        export LANG LANGUAGE LC_MESSAGES LC_ALL
    fi
    exec <%= @client_bin %> -i <%= node["chef_client"]["interval"] %> -s <%= node["chef_client"]["splay"] %> <%= node["chef_client"]["daemon_options"].join(' ') %>
end script
