]> git.llucax.com Git - software/pymin.git/commitdiff
Cambios ppp.
authorFede <fedux@linux-kt9u.site>
Mon, 22 Oct 2007 01:47:27 +0000 (22:47 -0300)
committerFede <fedux@linux-kt9u.site>
Mon, 22 Oct 2007 01:47:27 +0000 (22:47 -0300)
Se modifican parametros de los templates.
Se ambian prints por calls.

pymin/services/ppp/__init__.py
pymin/services/ppp/templates/nameX
pymin/services/ppp/templates/options.X

index bd82f1948fed8f783668284ada58eb9e160187ce..868b6d59330729a946309128ef91e85f99c9a31a 100644 (file)
@@ -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)
 
index 10524ff0ca90e6994d1172ae678456e503a6bff2..ee70cf118dcd6a845df8455b9e88769436b3f3ab 100644 (file)
@@ -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}
index ffaf43f17d6e869e032ef33606387a3e8c66333c..6ac57141ced0abd631d14284a93ee5170fa56ff0 100644 (file)
@@ -1,3 +1,4 @@
+linkname ${conn.name}
 % if conn.type == 'PPP':
 lock ${conn.device}
 % elif conn.type == 'OE':