Modify

Ticket #926 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

Rules - service check on localized systems

Reported by: Thomas Ackermann <saft@…> Owned by: solj
Priority: minor Milestone: Bcfg2 1.2.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc: sol.jerome@…

Description

chkconfigs output when system is not set to english is not interpreted correctly by the service rules.

for example:

/sbin/chkconfig --list nullmailer

< nullmailer 0:Aus 1:Aus 2:Ein 3:Ein 4:Ein 5:Ein 6:Aus

/sbin/chkconfig --list|grep :on

Found active services:

Verifying packa...

Attachments

Change History

comment:1 Changed 11 years ago by solj

  • Milestone changed from Bcfg2 1.1.0 Release to Bcfg2 1.1.1 Release (Bugfix)

comment:2 Changed 11 years ago by solj

  • Milestone changed from Bcfg2 1.1.1 Release (Bugfix) to Bcfg2 1.1.2 Release (Bugfix)

comment:3 Changed 11 years ago by solj

  • Cc sol.jerome@… added
  • Owner changed from desai to solj
  • Status changed from new to accepted

Does the following patch correct the issue on your system?

diff --git a/src/lib/Client/Tools/Chkconfig.py b/src/lib/Client/Tools/Chkconfig.py
index b7227ec..0d864e1 100644
--- a/src/lib/Client/Tools/Chkconfig.py
+++ b/src/lib/Client/Tools/Chkconfig.py
@@ -7,6 +7,9 @@ __revision__ = '$Revision$'
 import Bcfg2.Client.Tools
 import Bcfg2.Client.XML
 
+# chkconfig localization mapping
+CHKCFG_MAP = {'on': ['on', 'ein']}
+
 
 class Chkconfig(Bcfg2.Client.Tools.SvcTool):
     """Chkconfig support for Bcfg2."""
@@ -27,7 +30,7 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool):
             srvdata = [line.split() for line in raw for pattern in patterns \
                        if pattern not in line][0]
         except IndexError:
-            # Ocurrs when no lines are returned (service not installed)
+            # Occurs when no lines are returned (service not installed)
             entry.set('current_status', 'off')
             return False
         if len(srvdata) == 2:
@@ -40,7 +43,7 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool):
 
         try:
             onlevels = [level.split(':')[0] for level in srvdata[1:] \
-                        if level.split(':')[1] == 'on']
+                        if level.split(':')[1] in CHKCFG_MAP['on']]
         except IndexError:
             onlevels = []
 
@@ -91,7 +94,7 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool):
     def FindExtra(self):
         """Locate extra chkconfig Services."""
         allsrv = [line.split()[0] for line in \
-                  self.cmd.run("/sbin/chkconfig --list|grep :on")[1]]
+                  self.cmd.run("/sbin/chkconfig --list|grep -i :'on\|ein'")[1]]
         self.logger.debug('Found active services:')
         self.logger.debug(allsrv)
         specified = [srv.get('name') for srv in self.getSupportedEntries()]

comment:4 Changed 11 years ago by solj

  • Milestone changed from Bcfg2 1.1.2 Release (Bugfix) to Bcfg2 1.2.0 Release

comment:5 Changed 10 years ago by solj

  • Milestone changed from Bcfg2 1.2.0 Release to Bcfg2 1.3.0 Release

comment:6 Changed 10 years ago by solj

  • Status changed from accepted to closed
  • Resolution set to fixed
  • Milestone changed from Bcfg2 1.3.0 Release to Bcfg2 1.2.0 Release

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.