11
11
# "AvahiService" class, and some lines in "main".
13
13
# Everything else is
14
# Copyright © 2008-2016 Teddy Hogeborn
15
# Copyright © 2008-2016 Björn Påhlsson
17
# This program is free software: you can redistribute it and/or modify
18
# it under the terms of the GNU General Public License as published by
14
# Copyright © 2008-2017 Teddy Hogeborn
15
# Copyright © 2008-2017 Björn Påhlsson
17
# This file is part of Mandos.
19
# Mandos is free software: you can redistribute it and/or modify it
20
# under the terms of the GNU General Public License as published by
19
21
# the Free Software Foundation, either version 3 of the License, or
20
22
# (at your option) any later version.
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# Mandos is distributed in the hope that it will be useful, but
25
# WITHOUT ANY WARRANTY; without even the implied warranty of
24
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
27
# GNU General Public License for more details.
27
29
# You should have received a copy of the GNU General Public License
28
# along with this program. If not, see
29
# <http://www.gnu.org/licenses/>.
30
# along with Mandos. If not, see <http://www.gnu.org/licenses/>.
31
32
# Contact the authors at <mandos@recompile.se>.
495
496
class AvahiServiceToSyslog(AvahiService):
496
497
def rename(self, *args, **kwargs):
497
498
"""Add the new name to the syslog messages"""
498
ret = AvahiService.rename(self, *args, **kwargs)
499
ret = super(AvahiServiceToSyslog, self).rename(self, *args,
499
501
syslogger.setFormatter(logging.Formatter(
500
502
'Mandos ({}) [%(process)d]: %(levelname)s: %(message)s'
501
503
.format(self.name)))
2882
2885
# Convert the SafeConfigParser object to a dict
2883
2886
server_settings = server_config.defaults()
2884
2887
# Use the appropriate methods on the non-string config options
2885
for option in ("debug", "use_dbus", "use_ipv6", "foreground"):
2888
for option in ("debug", "use_dbus", "use_ipv6", "restore",
2889
"foreground", "zeroconf"):
2886
2890
server_settings[option] = server_config.getboolean("DEFAULT",
2888
2892
if server_settings["port"]: