Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-136

puppet-agent services cannot be managed in a debian 8 chroot

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • puppet-agent 1.3.4
    • None
    • None
    • debian 8 (jessie) chroot environment on a debian 8 (jessie) host

    • Platform OS

    Description

      After installing puppet-agent in a debian 8 chroot, the services provided by puppet-agent cannot be managed.

      Expectation

      Services can be managed by puppet, including those services included with puppet-agent when puppet-agent is installed in a chroot environment.

      For example, other services such as ntp can be successfully managed with puppet

      root@lfxctvbz932qugy:/# puppet resource service ntp
      2015-12-18 21:05:45.207607 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:06:05.465595 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',
      }
      root@lfxctvbz932qugy:/# puppet resource service ntp
      2015-12-18 21:06:11.518268 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
      service { 'ntp':
        ensure => 'running',
        enable => 'true',
      }
      

      Result of defect

      The services provided by puppet-agent cannot be managed by puppet in a chroot environment.

      root@lfxctvbz932qugy:/# puppet resource service puppet ensure=running
      2015-12-18 20:58:47.718395 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
      Error: Could not find init script for 'puppet'
      Error: /Service[puppet]/ensure: change from stopped to running failed: Could not find init script for 'puppet'
      service { 'puppet':
        ensure => 'stopped',
      }
      root@lfxctvbz932qugy:/# puppet resource service pxp-agent ensure=running
      2015-12-18 20:58:57.971337 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
      Error: Could not find init script for 'pxp-agent'
      Error: /Service[pxp-agent]/ensure: change from stopped to running failed: Could not find init script for 'pxp-agent'
      service { 'pxp-agent':
        ensure => 'stopped',
      }
      root@lfxctvbz932qugy:/# puppet resource service mco ensure=running
      2015-12-18 20:59:06.329333 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
      Error: Could not find init script for 'mcollective'
      Error: /Service[mcollective]/ensure: change from stopped to running failed: Could not find init script for 'mcollective'
      service { 'mcollective':
        ensure => 'stopped',
      }
      

      Steps to reproduce

      Create chroot on a debian 8

      See debian instructions for details

      apt-get install binutils debootstrap
      mkdir -p /srv/chroot/jessie
      debootstrap --arch amd64 jessie /srv/chroot/jessie http://httpredir.debian.org/debian
      cat >> /etc/fstab <<EOF
      /dev /srv/chroot/jessie/dev auto bind 0 0
      /dev/pts /srv/chroot/jessie/dev/pts auto bind 0 0
      /proc /srv/chroot/jessie/proc auto bind 0 0
      EOF
      mount --all
      

      Enter chroot environment and complete setup

      chroot /srv/chroot/jessie
      cat > ./usr/sbin/policy-rc.d <<EOF
      #!/bin/sh
      exit 101
      EOF
      chmod a+x ./usr/sbin/policy-rc.d
      dpkg-divert --divert /usr/bin/ischroot.debianutils --rename /usr/bin/ischroot
      ln -s /bin/true /usr/bin/ischroot
      

      Install puppet-agent

      apt-get install -y curl
      curl -O http://builds.puppetlabs.lan/puppet-agent/21e15db494e74374c8bec1a95fd5fa614719a1d7/artifacts/deb/jessie/PC1/puppet-agent_1.3.2.140.g21e15db-1jessie_amd64.deb
      dpkg -i puppet-agent_1.3.2.140.g21e15db-1jessie_amd64.deb
      

      Attempt to start puppet service

      /# /opt/puppetlabs/bin/puppet resource service puppet ensure=running
      2015-12-18 21:32:14.692909 WARN  puppetlabs.facter - locale environment variables were bad; continuing with LANG=C
      Error: Could not find init script for 'puppet'
      Error: /Service[puppet]/ensure: change from stopped to running failed: Could not find init script for 'puppet'
      service { 'puppet':
        ensure => 'stopped',
      }
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              john.duarte John Duarte
              Votes:
              4 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support