[PUP-5577] confine :exists => "/run/systemd/system" breaks chroot installation Created: 2015/12/03  Updated: 2016/11/23  Resolved: 2015/12/22

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 4.4.0

Type: Bug Priority: Normal
Reporter: Ian Wienand Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PA-136 puppet-agent services cannot be manag... Accepted
Template:
Story Points: 1
Sprint: Client 2015-12-16, Client 2015-12-30
Release Notes: Bug Fix
Release Notes Summary: A puppet installation in a chroot environment on a RedHat osfamily might lack /run/systemd/system (e.g. if /run is not mounted yet) and so puppet wouldn't consider the systemd provider suitable. This restricts that check to Debian platforms to allow the use of puppet in such environments.

 Description   

The line

confine :exists => "/run/systemd/system" 

was added with [1] but breaks running puppet within a chroot environment that doesn't have /run mounted. When puppet doesn't see this directory, it assumes systemd isn't there and ends up falling back to "chkconfig" for service enablement which is quite confusing

[1] https://github.com/puppetlabs/puppet/commit/7fe61647f23650fc4c93cd6b54c654a20ff7c9f9



 Comments   
Comment by Ian Wienand [ 2015/12/03 ]

See also https://bugzilla.redhat.com/show_bug.cgi?id=1254616

Comment by John Duarte [ 2015/12/18 ]

Using puppet-agent at SHA 21e15db containing puppet at SHA 386c75e, services can successfully be managed in a chroot environment on a debian 8 system.

root@lfxctvbz932qugy:~# chroot /srv/chroot/jessie
root@lfxctvbz932qugy:/# puppet --version
2015-12-18 21:38:30.617466 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
4.3.2
root@lfxctvbz932qugy:/#  cat /opt/puppetlabs/puppet/VERSION
1.3.2.140.g21e15db
root@lfxctvbz932qugy:/#  puppet resource service ntp
2015-12-18 21:38:48.117399 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
service { 'ntp':
  ensure => 'stopped',
  enable => 'true',
}
root@lfxctvbz932qugy:/# puppet resource service ntp ensure=running
2015-12-18 21:38:56.863068 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
Notice: /Service[ntp]/ensure: ensure changed 'stopped' to 'running'
service { 'ntp':
  ensure => 'running',
}

Comment by Sven Mueller [ 2016/11/23 ]

Not sure if I should re-open this issue or create a new one:
The check for /run/systemd/system also breaks management of services in Debian chroots (such as the debootstrap chroot created during installations from debian-installer - in which we run Puppet for the first time during automated installations).
The problem is that it checks for a running systemd, it doesn't check for systemd to be in use by the given system.
The proper check to see if systemd is used on a given system would be to check if /sbin/init is a link to /lib/systemd/systemd

Generated at Wed Jan 22 23:35:25 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.