## A self-destruct service to boot chef client and register cron job echo "#!/bin/bash" > /target/etc/init.d/chef; \ echo "rm -rf /var/lib/rsyslog/firstboot_log" >> /target/etc/init.d/chef; \ echo "service rsyslog restart" >> /target/etc/init.d/chef; \ echo "/etc/chef/firstrun.sh" >> /target/etc/init.d/chef; \ echo "crontab -l > /tmp/mycron" >> /target/etc/init.d/chef; \ echo "echo \"*/30 * * * * /etc/chef/rerun.sh\" >> /tmp/mycron" >> /target/etc/init.d/chef; \ echo "crontab /tmp/mycron" >> /target/etc/init.d/chef; \ echo "rm /tmp/mycron" >> /target/etc/init.d/chef; \ echo "update-rc.d -f chef remove" >> /target/etc/init.d/chef; \ echo "mv /etc/init.d/chef /tmp/chef" >> /target/etc/init.d/chef; \ chmod +x /target/etc/init.d/chef; \ chroot /target update-rc.d chef defaults 99 20; \