baudm / ufw-frontends

Graphical frontends for the Uncomplicated Firewall (UFW)
http://code.google.com/p/ufw-frontends/
GNU General Public License v3.0
40 stars 10 forks source link

failure when a log file cannot be found #22

Open baudm opened 9 years ago

baudm commented 9 years ago

Original issue 21 created by baudm on 2013-10-13T18:39:40.000Z:

Hello!

When any of the supported log file location cannot be found, ufw-gtk doesn't start.

# ufw-gtk
/usr/lib/python2.7/site-packages/gfw/frontend_gtk.py:68: GtkWarning: Unknown property: GtkMenu.ubuntu-local
  self.ui.add_from_file(path)
Traceback (most recent call last):
  File "/usr/sbin/ufw-gtk-2.7", line 9, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/gfw/frontend_gtk.py", line 743, in main
    ui = GtkFrontend()
  File "/usr/lib/python2.7/site-packages/gfw/frontend_gtk.py", line 93, in __init__
    self._notifier = Notifier(callback)
  File "/usr/lib/python2.7/site-packages/gfw/frontend_gtk.py", line 37, in __init__
    gfw.event.Notifier.__init__(self, callback)
  File "/usr/lib/python2.7/site-packages/gfw/event.py", line 73, in __init__
    self._log = open('/var/log/messages.log', 'r')
IOError: [Errno 2] No such file or directory: '/var/log/messages.log'
Exception AttributeError: "'Notifier' object has no attribute '_log'" in <bound method Notifier.__del__ of <gfw.frontend_gtk.Notifier object at 0x9ee58ac>> ignored

(Actually, that's for users that use systemd/journal. At least on some of such systems, any of these log files cannot be found.)

ufw-frontends version: 0.3.2