diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2010-09-16 15:27:00 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-09-26 15:27:07 -0500 |
commit | 87c2bf31e1f2992a1733f5ce368e7336aa782663 (patch) | |
tree | 4d80972771e463cb30412488a6d8b598a4e5751d /src/lib/Client | |
parent | d78178f0a6412809a7ab0471d048c800ba9ac8b1 (diff) | |
download | bcfg2-87c2bf31e1f2992a1733f5ce368e7336aa782663.tar.gz bcfg2-87c2bf31e1f2992a1733f5ce368e7336aa782663.tar.bz2 bcfg2-87c2bf31e1f2992a1733f5ce368e7336aa782663.zip |
DebInit: implement support for dependency-based boot in Squeeze and beyond
(patch from https://www.google.com/accounts/o8/id?id=AItOawlG5aiZZ6D7CrCtcInFhXmj7TC9AOKTyb8)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6060 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Tools/DebInit.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/DebInit.py b/src/lib/Client/Tools/DebInit.py index 9df8bb127..0185f420c 100644 --- a/src/lib/Client/Tools/DebInit.py +++ b/src/lib/Client/Tools/DebInit.py @@ -4,6 +4,13 @@ __revision__ = '$Revision$' import glob, os, re import Bcfg2.Client.Tools + +# Debian squeeze and beyond uses a dependecy based boot sequence +DEBIAN_OLD_STYLE_BOOT_SEQUENCE = ( + 'etch', '4.0', + 'lenny', '5.0', '5.0.1', '5.0.2', '5.0.3', '5.0.4', '5.0.4', '5.0.5', + ) + class DebInit(Bcfg2.Client.Tools.SvcTool): """Debian Service Support for Bcfg2.""" name = 'DebInit' @@ -17,9 +24,18 @@ class DebInit(Bcfg2.Client.Tools.SvcTool): """Verify Service status for entry.""" rawfiles = glob.glob("/etc/rc*.d/[SK]*%s" % (entry.get('name'))) files = [] + + try: + deb_version = open('/etc/debian_version', 'r').read().split('/', 1)[0] + except IOError: + deb_version = 'unknown' + if entry.get('sequence'): - start_sequence = int(entry.get('sequence')) - kill_sequence = 100 - start_sequence + if (deb_version in DEBIAN_OLD_STYLE_BOOT_SEQUENCE): + start_sequence = int(entry.get('sequence')) + kill_sequence = 100 - start_sequence + else: + self.logger.warning("Your debian version boot sequence is dependency based \"sequence\" attribute wil be ignored.") else: start_sequence = None |