From: Fede Date: Mon, 22 Oct 2007 01:47:27 +0000 (-0300) Subject: Cambios ppp. X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/60de22ab6dba022c4a6ed243c15f1e941f8154cd?ds=sidebyside;hp=-c Cambios ppp. Se modifican parametros de los templates. Se ambian prints por calls. --- 60de22ab6dba022c4a6ed243c15f1e941f8154cd diff --git a/pymin/services/ppp/__init__.py b/pymin/services/ppp/__init__.py index bd82f19..868b6d5 100644 --- a/pymin/services/ppp/__init__.py +++ b/pymin/services/ppp/__init__.py @@ -67,8 +67,8 @@ class ConnectionHandler(DictSubHandler): handler_help = u"Manages connections for the ppp service" - _dict_subhandler_attr = 'conns' - _dict_subhandler_class = Connection + _cont_subhandler_attr = 'conns' + _cont_subhandler_class = Connection class PppHandler(Restorable, ConfigWriter, TransactionalHandler): @@ -94,16 +94,18 @@ class PppHandler(Restorable, ConfigWriter, TransactionalHandler): @handler('Starts the service') def start(self, name): if name in self.conns: - #call(('pon', name)) - print ('pon', name) + call(['pppd','call', name],stdout=None, stderr=None) + #print ('pon', name) else: raise ConnectionNotFoundError(name) @handler('Stops the service') def stop(self, name): if name in self.conns: - #call(('poff', name)) - print ('poff', name) + if path.exists('/var/run/ppp-' + name + '.pid'): + pid = file('/var/run/ppp-' + name + '.pid').readline().strip() + call(['kill',pid],stdout=None, stderr=None) + #print ('poff', name) else: raise ConnectionNotFoundError(name) diff --git a/pymin/services/ppp/templates/nameX b/pymin/services/ppp/templates/nameX index 10524ff..ee70cf1 100644 --- a/pymin/services/ppp/templates/nameX +++ b/pymin/services/ppp/templates/nameX @@ -1,7 +1,16 @@ +updetach % if conn.type != 'TUNNEL': name ${conn.username} file /etc/ppp/options.${conn.name} ipparam ${conn.name} +# pppoe has a lower mtu/mru +mtu 1492 +mru 1492 +# switch off all compressions (this is a must) +nopcomp +# this is recommended +novjccomp +noccp % else: pty "pptp ${conn.server} --nolaunchpppd" name ${conn.username} diff --git a/pymin/services/ppp/templates/options.X b/pymin/services/ppp/templates/options.X index ffaf43f..6ac5714 100644 --- a/pymin/services/ppp/templates/options.X +++ b/pymin/services/ppp/templates/options.X @@ -1,3 +1,4 @@ +linkname ${conn.name} % if conn.type == 'PPP': lock ${conn.device} % elif conn.type == 'OE':