| Gheorghe Popescu Thank you for creating a ticket for this! Since commenting in https://tickets.puppetlabs.com/browse/PUP-7312 I have not been able to reliably reproduce the issue I was having using Vagrant. I have created a minimal Puppet module for this at https://github.com/antaflos/puppet-foobar. On our in-house built Ubuntu 18.04 Vagrant boxes the spec tests would reliably fail with the aforementioned error message, but on the official ubuntu/bionic64 boxes (https://app.vagrantup.com/ubuntu/boxes/bionic64) the spec tests would reliably pass. I have no idea why and still cannot figure it out. Drives me crazy  I am glad this issue got attention and a fix so quickly! Thanks to all involved! Not that it matters much now, and just out of curiosity: couldn't Puppet also just look at /sbin/init, much like it looked at /proc/1/exe and read the symlink target? This works for regular users, not just root. As in:
confine :true => Puppet::FileSystem.exist?('/sbin/init') && Puppet::FileSystem.readlink('/sbin/init').include?('systemd')
|
Maybe in addition to looking at /proc/1/exe, i.e.:
confine :true => (Puppet::FileSystem.exist?('/proc/1/exe') && Puppet::FileSystem.readlink('/proc/1/exe').include?('systemd')) || |
(Puppet::FileSystem.exist?('/sbin/init') && Puppet::FileSystem.readlink('/sbin/init').include?('systemd'))
|
|