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):
@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)
+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}