compass-adapters/cobbler/snippets/preseed_chef_init
xiaodongwang ae44332c69 update snippet to support preseed
Change-Id: I8442758ffaf3a55ec4773bf820bc4cdefb2e6452
2014-05-19 10:47:36 -07:00

14 lines
795 B
Plaintext

## 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; \