[PUP-9398] Race condition exists when cron resource specified but cron is not installed and gets installed by puppet Created: 2019/01/04 Updated: 2019/01/07
|Affects Version/s:||PUP 5.3.6, PUP 6.1.0|
|Labels:||cron, linux, type_and_provider|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Template:||PUP Bug Template customfield_10700 290455|
|Method Found:||Needs Assessment|
|QA Risk Assessment:||Needs Assessment|
Puppet Version: All tested (latest)
When a system does not have a cron handler installed, but the manifest installs cron and then installs a cron entry for a user, the cron entry will NOT get added to the user but instead to root. If you run again it will install for the user. This is obviously not intended and can potentially create a security risk (as cronjobs will run as root unintended). More importantly, it breaks stuff.
Here is a sample that you can replace your site.pp with and run against an agent to reproduce:
The first time you run this it will install cronie, and install this crontab under root.