Ask Your Question
0

How do you manage a package with tons of dependent package?

asked 2017-02-24 10:58:06 -0500

evil_del gravatar image

Hi,

We have package 'foobar' and when Puppet installs a new version, it restarts service foobar. All good.

foobar has dozens of dependencies, for example 'lib-foobar'. Puppet knows about these, also. When these packages are updated, the service foobar restarts. All good.

lib-foobar, itself has dependencies, eg lib-math-foobar. When lib-math-foobar is updated, Puppet does know about it and DOESNT restart the foobar service. So the package manager is doing everything it should. The only issue is that Puppet doesn't know about lib-math-foobar. Is there a way that Puppet can use the debian/control file to know about these dependencies? This could then trigger the service to restart.

Cheers, D.

edit retag flag offensive close merge delete

Comments

Use `unattended-upgrade(8)`. Don't forget to set `Unattended-Upgrade::Automatic-Reboot "true";` in your apt.conf.

Kai Burghardt gravatar imageKai Burghardt ( 2017-02-24 15:43:01 -0500 )edit

@Kai The "unattended-upgrade" package has to do with security patches being applied automatically. The automatic reboot option only tells Ubuntu to restart when the file "/var/run/reboot-required" is found after the upgrade. This doesn't have anything to do with what the poster is asking.

luksi1 gravatar imageluksi1 ( 2017-02-27 01:58:46 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2017-02-27 02:22:07 -0500

As far as I know, there is no module that could build up a relationship hierarchy from a package control file in Ubuntu. There's two way that we handle this.

First, specify the versions of the package that you want and place a notify to your service.

package {'foobar':
  ensure => '1.0.2',
  notify => Service['foobar'],
}

package {'lib-foobar':j
  ensure => '0.0.2',
  notify => Service['foobar'],
}

package {'lib-math-foobar':
  ensure => '4.0.2',
  notify  => Service['foobar'],
}

Alternatively, repackage your .deb package with the correct dependencies and their version and then increase your version number of your package.

Maybe something like this in your control file.

Depends: lib-math-foo (= 4.0.2)

Notice that you will need to specify an exact version of your package! There is no 'latest' option in a Debian control file.

And then simply increase the version number of foobar to '1.0.3'. In Puppet, you could then simply say:

package {'foobar':
  ensure => 'latest',
  notify  => Service['foobar']
}

This will parse the control file, see that a dependency is not met, upgrade your library and then restart the service. We normally use this approach for packages in our local repo.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-24 10:58:06 -0500

Seen: 36 times

Last updated: Feb 27