From cac70f41939ddab892bea5240c08a822880539f7 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Wed, 3 Sep 2014 21:06:04 +0200 Subject: [PATCH] =?UTF-8?q?dhcpd:=20on=20restart=20via=20monit=20pour=20?= =?UTF-8?q?=C3=A9viter=20le=20spam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sinon, monit n'est pas au courant et signale en permanence des changements de pid --- gestion/gen_confs/dhcpd_new.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/gestion/gen_confs/dhcpd_new.py b/gestion/gen_confs/dhcpd_new.py index 60100862..3ae16e55 100644 --- a/gestion/gen_confs/dhcpd_new.py +++ b/gestion/gen_confs/dhcpd_new.py @@ -16,6 +16,7 @@ if '/usr/scripts' not in sys.path: from gestion.iptools import AddrInNet from gestion.gen_confs import gen_config from gestion.config import NETs +from gestion.config.services import services from gestion import secrets_new as secrets # Relative imports @@ -83,8 +84,8 @@ class dhcp(gen_config) : """ ######################################PARTIE DE CONFIGURATION # Fichier à écire - if hostname in ['dhcp', 'isc']: - restart_cmd = '/etc/init.d/isc-dhcp-server restart' + if hostname in services.get('isc-dhcp-server', []): + restart_cmd = '/usr/bin/monit restart isc-dhcp-server' reseaux = { '138.231.136.0/21' : '/etc/dhcp3/generated/adherents.liste', '10.42.0.0/16' : '/etc/dhcp3/generated/gratuit.liste', '10.2.9.0/24' : '/etc/dhcp3/generated/appartements.liste', @@ -102,17 +103,6 @@ class dhcp(gen_config) : } """ - host_template_ltsp_powerpc = """ - host %(nom)s { - hardware ethernet %(mac)s; - fixed-address %(ip)s; - option host-name "%(host)s"; - next-server 138.231.136.98; - filename "yaboot"; - option root-path "/opt/ltsp/powerpc"; - } -""" - ### Verbosité # Si =1 ralera (chaine warnings) si machines hors zone trouvée # Si =0 ralera seulement si réseau vide