puppet agent jessie not started after install with dpkg (BUG)

asked 2016-04-20 03:17:24 -0500

FranzCC gravatar image

updated 2016-04-20 03:18:14 -0500

I use razor along with debian preseed
My os_boot.erb downloads the agent .deb package (dependencies are installed before using d-i)
Then dpkg -i <package> will installed the package which succeeds)
Nevertheless the service will not start via systemd, because the postinst script doesn't enable the service ?!?.
The BUG:
When debian configures the package, 2 arguments will be passed:
ARG1: configure
ARG2: 1.4.1-1jessie

The postinstall script then wrongly does:

 if [ -z "$2" ]; then
  systemctl enable puppet.service >/dev/null || :
else
  systemctl try-restart puppet.service >/dev/null || :
fi

The "try-restart" will never succeed due the fact that the service hasn't been enabled before.
Systemd considers the service as dead ;-)

Don't puppet inc. test their packages ?!??!

In the postinstall script you have to:
1.) Check if the service hasn't been enabled.
2.)If not, enable the service and then start the service

My workraround in os_boot.erb

/bin/systemctl enable puppet.service 2>&1>/dev/null
/bin/systemctl restart puppet 2>&1>/dev/null

Quite annoying though !

edit retag flag offensive close merge delete