Nouvelle gestion de lock encore plus efficace.
darcs-hash:20050402150536-d1718-3e9c2ba11984c64fc6d9a695132440cae05f295b.gz
This commit is contained in:
parent
8306127fe1
commit
6c703307d7
2 changed files with 11 additions and 13 deletions
|
@ -20,7 +20,7 @@ sys.path.append('/usr/scripts/gestion')
|
||||||
from ldap_crans import crans_ldap, crans, smtpserv, hostname
|
from ldap_crans import crans_ldap, crans, smtpserv, hostname
|
||||||
from lock import *
|
from lock import *
|
||||||
from affich_tools import anim, cprint, OK, ERREUR, WARNING
|
from affich_tools import anim, cprint, OK, ERREUR, WARNING
|
||||||
from time import localtime, strftime, time
|
from time import localtime, strftime, time, sleep
|
||||||
import config
|
import config
|
||||||
|
|
||||||
args_autorises = ['quiet', 'remove=', 'add=', 'list' ,'help', 'reconnect']
|
args_autorises = ['quiet', 'remove=', 'add=', 'list' ,'help', 'reconnect']
|
||||||
|
@ -325,6 +325,13 @@ if hostname == 'zamok':
|
||||||
|
|
||||||
|
|
||||||
elif hostname == 'nectaris':
|
elif hostname == 'nectaris':
|
||||||
|
restart_wifi_update = False
|
||||||
|
if 'conf_wifi' in to_do.keys() or 'bornes_wifi' in to_do.keys():
|
||||||
|
# On arrete wifi-update
|
||||||
|
os.system("kill $(cat /var/run/wifi-update.pid)")
|
||||||
|
sleep(1)
|
||||||
|
restart_wifi_update = True
|
||||||
|
|
||||||
# On s'occupe de nectaris
|
# On s'occupe de nectaris
|
||||||
if 'conf_wifi' in to_do.keys():
|
if 'conf_wifi' in to_do.keys():
|
||||||
if auto : db.services_to_restart('-conf_wifi')
|
if auto : db.services_to_restart('-conf_wifi')
|
||||||
|
@ -369,6 +376,9 @@ elif hostname == 'nectaris':
|
||||||
if auto : db.services_to_restart('droits-nectaris')
|
if auto : db.services_to_restart('droits-nectaris')
|
||||||
sys.stdout.write('Erreur dans la config des droits sur nectaris.\n')
|
sys.stdout.write('Erreur dans la config des droits sur nectaris.\n')
|
||||||
|
|
||||||
|
if restart_wifi_update:
|
||||||
|
os.system("cd / ; systrace -d /etc/systrace/wifi-update -A /usr/local/bin/twistd --syslog -o -y /usr/scripts/gestion/wifi-update.py --pidfile=/var/run/wifi-update.pid")
|
||||||
|
|
||||||
elif hostname == 'sila' :
|
elif hostname == 'sila' :
|
||||||
if 'bl_carte_etudiant' in to_do.keys() :
|
if 'bl_carte_etudiant' in to_do.keys() :
|
||||||
if auto : db.services_to_restart('-bl_carte_etudiant')
|
if auto : db.services_to_restart('-bl_carte_etudiant')
|
||||||
|
|
|
@ -99,12 +99,6 @@ Netmask= 0.0.0.0
|
||||||
|
|
||||||
def __init__(self) :
|
def __init__(self) :
|
||||||
self.db = crans_ldap()
|
self.db = crans_ldap()
|
||||||
# Pour eviter le probleme de lock...
|
|
||||||
os.system("kill $(cat /var/run/wifi-update.pid)")
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
os.system("cd / ; systrace -d /etc/systrace/wifi-update -A /usr/local/bin/twistd --syslog -o -y /usr/scripts/gestion/wifi-update.py --pidfile=/var/run/wifi-update.pid")
|
|
||||||
|
|
||||||
def lockname(self):
|
def lockname(self):
|
||||||
# On change le nom du lock pour avoir un nom unique pour tout ce qui
|
# On change le nom du lock pour avoir un nom unique pour tout ce qui
|
||||||
|
@ -195,12 +189,6 @@ class bornes_wifi(gen_config) :
|
||||||
def __init__(self,bornes=[]) :
|
def __init__(self,bornes=[]) :
|
||||||
self.db = crans_ldap()
|
self.db = crans_ldap()
|
||||||
self.bornes = bornes
|
self.bornes = bornes
|
||||||
# Pour eviter le probleme de lock...
|
|
||||||
os.system("kill $(cat /var/run/wifi-update.pid)")
|
|
||||||
time.sleep(1)
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
os.system("cd / ; systrace -d /etc/systrace/wifi-update -A /usr/local/bin/twistd --syslog -o -y /usr/scripts/gestion/wifi-update.py --pidfile=/var/run/wifi-update.pid")
|
|
||||||
|
|
||||||
def _gen(self) :
|
def _gen(self) :
|
||||||
bornes = self.db.search('host=*.wifi.crans.org&puissance=*')['machine']
|
bornes = self.db.search('host=*.wifi.crans.org&puissance=*')['machine']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue