I'm starting puppet agent using upstart on a Debian 14.04 embedded system:
description "Puppet Agent"
start on started 2klic-gateway
stop on runlevel [!2345]
respawn
pre-start script
if [ ! -f /var/lib/sc2klic/system.json ]; then
stop ; exit 0
fi
puppet config set certname "$(hostname)"
end script
exec /usr/local/bin/puppet agent --no-daemonize
The device, or at least this version, doesn't have a hardware clock. So the system starts with a date of January 1, 1970.
When I look in /var/log/upstart/puppet-agent.log
I see this error over and over again:
ESC[1;31mError: Could not parse application options: copyright with a year after 1972 is very strange; did you accidentally add or subtract two years?ESC[0m
Is it possible to initialize puppet agent without having a correct date?
Puppet Agent Version 4.10.1
This error seems to be related to the documentation so I don't know if it should error here. I proposed a pull-request to make an exception to not trigger in this situation.
That said we know if year is 1970 the device is not online, thus puppet can't be used anyways.
As a work around I added the following to the upstart pre-start script:
while [[ $(date +%Y) == "1970" ]]
do
sleep 30
done
This way we just keep puppet waiting until the device has connected to an NTP server.