mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-25 08:33:22 +03:00
Working around netifaces segfault on FreeBSD
netifaces.gateways() function segmentation fault on FreeBSD, making Glances unusable. As a workaround, just disable netifaces on FreeBSD. See https://bitbucket.org/al45tair/netifaces/issues/15. Fixes #670.
This commit is contained in:
parent
1427274e50
commit
7cfc223c12
@ -35,7 +35,7 @@ except ImportError:
|
||||
zeroconf_tag = False
|
||||
|
||||
# Import Glances libs
|
||||
from glances.core.glances_globals import appname
|
||||
from glances.core.glances_globals import appname, is_freebsd
|
||||
from glances.core.glances_logging import logger
|
||||
|
||||
# Zeroconf 0.17 or higher is needed
|
||||
@ -194,6 +194,9 @@ class GlancesAutoDiscoverClient(object):
|
||||
except socket.error as e:
|
||||
logger.error("Cannot start zeroconf: {0}".format(e))
|
||||
|
||||
# XXX FreeBSD: Segmentation fault (core dumped)
|
||||
# -- https://bitbucket.org/al45tair/netifaces/issues/15
|
||||
if not is_freebsd:
|
||||
try:
|
||||
# -B @ overwrite the dynamic IPv4 choice
|
||||
if zeroconf_bind_address == '0.0.0.0':
|
||||
|
@ -33,6 +33,7 @@ is_py3 = sys.version_info >= (3, 3)
|
||||
# Operating system flag
|
||||
# Note: Somes libs depends of OS
|
||||
is_bsd = sys.platform.find('bsd') != -1
|
||||
is_freebsd = sys.platform.startswith('freebsd')
|
||||
is_linux = sys.platform.startswith('linux')
|
||||
is_mac = sys.platform.startswith('darwin')
|
||||
is_windows = sys.platform.startswith('win')
|
||||
|
@ -19,16 +19,21 @@
|
||||
|
||||
"""IP plugin."""
|
||||
|
||||
# Import system libs
|
||||
# Import Glances libs
|
||||
from glances.core.glances_globals import is_freebsd
|
||||
from glances.core.glances_logging import logger
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
|
||||
# XXX FreeBSD: Segmentation fault (core dumped)
|
||||
# -- https://bitbucket.org/al45tair/netifaces/issues/15
|
||||
if not is_freebsd:
|
||||
try:
|
||||
import netifaces
|
||||
netifaces_tag = True
|
||||
except ImportError:
|
||||
netifaces_tag = False
|
||||
|
||||
# Import Glances libs
|
||||
from glances.core.glances_logging import logger
|
||||
from glances.plugins.glances_plugin import GlancesPlugin
|
||||
else:
|
||||
netifaces_tag = False
|
||||
|
||||
|
||||
class Plugin(GlancesPlugin):
|
||||
|
Loading…
Reference in New Issue
Block a user