Ticket #878 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

Upstart service status with no output produces traceback

Reported by: Joe Digilio <[email protected]…> Owned by: solj
Priority: major Milestone: Bcfg2 1.1.0 Release
Component: bcfg2-client Version: 1.0
Keywords: Cc: [email protected]


On Ubuntu 10.04 (with bcfg2-1.1.0-0.1rc1), I get the following traceback for two services (grub-common and bcfg2):

Unexpected failure of verification method for entry type Service
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/Bcfg2/Client/Tools/", line 146, in Inventory
    states[entry] = func(entry, mods)
  File "/usr/lib/pymodules/python2.6/Bcfg2/Client/Tools/", line 33, in VerifyService
IndexError: list index out of range

Running the following produces no output:

# /usr/sbin/service grub-common status
# /usr/sbin/service bcfg2 status


Change History

comment:1 Changed 13 years ago by solj

  • Owner changed from desai to solj
  • Status changed from new to accepted

The reason for this is that neither of those services are handled via Upstart. You need to define them with type='deb' in your configuration so that they are handled by DebInit?. I'll work on fixing the traceback.

comment:2 Changed 13 years ago by solj

This patch should fix your issue:

diff --git a/src/lib/Client/Tools/ b/src/lib/Client/Tools/
index 1fc80a1..b6e68d5 100644
--- a/src/lib/Client/Tools/
+++ b/src/lib/Client/Tools/
@@ -29,8 +29,13 @@ class Upstart(Bcfg2.Client.Tools.SvcTool):
            /etc/init/servicename.conf. All we need to do is make sure
            the service is running when it should be.
-        output ='/usr/sbin/service %s status' % \
-                              entry.get('name'))[1][0]
+        try:
+            output ='/usr/sbin/service %s status' % \
+                                  entry.get('name'))[1][0]
+        except IndexError:
+            self.logger.error("Service %s not an Upstart service" % \
+                              entry.get('name'))
+            return False
             running = output.split(' ')[1].split('/')[1].startswith('running')
             if running:

comment:3 Changed 13 years ago by solj

  • Status changed from accepted to closed
  • Resolution set to fixed

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


Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.