Problem:
I’ve installed puppet per the steps in the link below but have not been successful at getting the service to run. I can run the agent manually, or get it to stay running by calling puppet service --no-daemonize , but i’ve not been successful at getting the service to load automatically.
I’ve tried to force it to run using systemd, however it really seems to want to use init
root@octopi:~# puppet resource service puppet enable=true ensure=running provider=systemd
Warning: Found multiple default providers for service: init, systemd; using init
Warning: Found multiple default providers for service: init, systemd; using init
Error: /Service[puppet]: Could not evaluate: Could not find init script for ‘puppet’
Error: Could not run: Could not find init script for ‘puppet’
I tried transplanting a init.d script for puppet 5.5 but it seems to just call “puppet agent”, and attempts to add --no-daemonize haven’t really been sucesfull.
Have you tried directly using systemctl instead of the puppet resource command?
It looks like the resource command is doing something wrong by ignoring the provider setting, but the service file for puppet looks good, so I would think systemctl start puppet.service && systemctl enable puppet.service should work fine.
By placing it directly in multi-user.target.wants you break enable/disable functionality.
I’d expect it to be /etc/systemd/system/multi-user.target.wants/puppet.service. Then you use:
systemctl daemon-reload
(which I also think is missing in the current instructions)
Then use systemctl enable puppet.service to enable it at boot. You can also use systemctl enable --now puppet.service to start it immediately (instead of also calling systemctl start).
The second path should be /etc/systemd/system/puppet.service (good catch, ignoring the copy&paste error) and the systemctl daemon-reload is missing but it should only be necessary with later changes and work fine when a unit file is placed there for the first time.