On Fri, Jan 28, 2011 at 9:28 AM, Dan Urist <[email protected]> wrote:
> A little background: I'm using puppet to manage the configurations of a
> group of linux vservers running Ubuntu Lucid. Ubuntu has switched to
> using upstart for their boot process; unfortunately there are some
> peculiar interactions with vservers which causes openssh to hang during
> upgrade, so I need to remove the upstart init script for openssh and
> revert back to the sysvrc script instead. Since this needs to happen
> before any openssh upgrade, I've tried putting the code that does this
> into a class that will be run first, like this:
>
> class disable_upstart_for_sshd {
>  file {
>    '/etc/init/ssh.conf':
>      ensure => absent
>  }
>  exec {
>    '/usr/sbin/update-rc.d ssh defaults':
>      creates => '/etc/rc3.d/S20ssh'
>  }
> }
>
> stage { "pre": before => Stage[main] }
> class {
>  disable_upstart_for_sshd': stage => pre;
> }
>
> Now, if /etc/init/ssh.conf exists, puppet will correctly remove it and
> the run will complete without error, but on the *next* and all
> subsequent puppet runs I get a long dependency cycle error.
>
> If /etc/init/ssh.conf does not exist, I get no errors (on multiple
> runs).
>
> If I remove the run stage code, I get no errors (on multiple runs).
>
> There are no explicit references to /etc/init/ssh.conf in any other
> modules (it's owned by the openssh-server package).
>
> So, is this a bug?

This does not appear to be a bug. There's an implicit dependency for
the file /etc/init/ssh.conf on file resource /etc/init. File /etc/init
is in stage main, and File /etc/init/ssh.conf in in stage pre which
cause a dependency loop. In this case, I would simply make the ssh
package depend on the changes you've implemented.

package { "ssh":
   ensure => latest,
   require => Class["disable_upstart_for_sshd"],
}

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to