/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: Teddy Hogeborn
  • Date: 2015-07-07 15:49:49 UTC
  • Revision ID: teddy@recompile.se-20150707154949-vbuj4pc6wf3o1vgz
mandos.service: Use Type=dbus (implicitly).

mandos.service ([Service]/Type): Removed.
               ([Service]/BusName): Uncommented; set to
                                    "se.recompile.Mandos".

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
            gobject.source_remove(self._update_timer_callback_tag)
174
174
            self._update_timer_callback_tag = None
175
175
    
176
 
    def checker_completed(self, exitstatus, condition, command):
 
176
    def checker_completed(self, exitstatus, signal, command):
177
177
        if exitstatus == 0:
178
178
            self.logger('Checker for client {} (command "{}")'
179
179
                        ' succeeded'.format(self.properties["Name"],
181
181
            self.update()
182
182
            return
183
183
        # Checker failed
184
 
        if os.WIFEXITED(condition):
 
184
        if exitstatus >= 0:
185
185
            self.logger('Checker for client {} (command "{}") failed'
186
186
                        ' with exit code {}'
187
187
                        .format(self.properties["Name"], command,
188
 
                                os.WEXITSTATUS(condition)))
189
 
        elif os.WIFSIGNALED(condition):
 
188
                                exitstatus))
 
189
        elif signal != 0:
190
190
            self.logger('Checker for client {} (command "{}") was'
191
191
                        ' killed by signal {}'
192
192
                        .format(self.properties["Name"], command,
193
 
                                os.WTERMSIG(condition)))
 
193
                                signal))
 
194
        else:
 
195
            self.logger('Checker for client {} completed'
 
196
                        ' mysteriously'
 
197
                        .format(self.properties["Name"]))
194
198
        self.update()
195
199
    
196
200
    def checker_started(self, command):
329
333
        """Handle keys.
330
334
        This overrides the method from urwid.FlowWidget"""
331
335
        if key == "+":
332
 
            self.proxy.Set(client_interface, "Enabled",
333
 
                           dbus.Boolean(True), ignore_reply = True,
334
 
                           dbus_interface = dbus.PROPERTIES_IFACE)
 
336
            self.proxy.Enable(dbus_interface = client_interface,
 
337
                              ignore_reply=True)
335
338
        elif key == "-":
336
 
            self.proxy.Set(client_interface, "Enabled", False,
337
 
                           ignore_reply = True,
338
 
                           dbus_interface = dbus.PROPERTIES_IFACE)
 
339
            self.proxy.Disable(dbus_interface = client_interface,
 
340
                               ignore_reply=True)
339
341
        elif key == "a":
340
342
            self.proxy.Approve(dbus.Boolean(True, variant_level=1),
341
343
                               dbus_interface = client_interface,
349
351
                                                  .object_path,
350
352
                                                  ignore_reply=True)
351
353
        elif key == "s":
352
 
            self.proxy.Set(client_interface, "CheckerRunning",
353
 
                           dbus.Boolean(True), ignore_reply = True,
354
 
                           dbus_interface = dbus.PROPERTIES_IFACE)
 
354
            self.proxy.StartChecker(dbus_interface = client_interface,
 
355
                                    ignore_reply=True)
355
356
        elif key == "S":
356
 
            self.proxy.Set(client_interface, "CheckerRunning",
357
 
                           dbus.Boolean(False), ignore_reply = True,
358
 
                           dbus_interface = dbus.PROPERTIES_IFACE)
 
357
            self.proxy.StopChecker(dbus_interface = client_interface,
 
358
                                   ignore_reply=True)
359
359
        elif key == "C":
360
360
            self.proxy.CheckedOK(dbus_interface = client_interface,
361
361
                                 ignore_reply=True)