]> git.llucax.com Git - software/pymin.git/blobdiff - pymin/services/vpn/__init__.py
Improve ProcessManager to manage registerable named services.
[software/pymin.git] / pymin / services / vpn / __init__.py
index 1e84361fbf5f4a6f219cec891ba2c846e33235da..d25164032323face72f1f5f990532c2ffa3222e6 100644 (file)
@@ -1,8 +1,10 @@
 # vim: set encoding=utf-8 et sw=4 sts=4 :
 
 import os
 # vim: set encoding=utf-8 et sw=4 sts=4 :
 
 import os
+import signal
 from os import path
 
 from os import path
 
+
 from pymin.seqtools import Sequence
 from pymin.dispatcher import Handler, handler, HandlerError
 from pymin.services.util import Restorable, ConfigWriter, InitdHandler, \
 from pymin.seqtools import Sequence
 from pymin.dispatcher import Handler, handler, HandlerError
 from pymin.services.util import Restorable, ConfigWriter, InitdHandler, \
@@ -106,10 +108,10 @@ class VpnHandler(Restorable, ConfigWriter,
     @handler('usage: stop <vpn_name>')
     def stop(self, vpn_src):
         if vpn_src in self.vpns:
     @handler('usage: stop <vpn_name>')
     def stop(self, vpn_src):
         if vpn_src in self.vpns:
-            if path.exists('/var/lib/run/tincd.' + vpn_src + '.pid'):
-                pid = file('/var/lib/run/tincd.' + vpn_src + '.pid').readline()
+            if path.exists('/var/run/tinc.' + vpn_src + '.pid'):
+                pid = file('/var/run/tinc.' + vpn_src + '.pid').readline()
                 try:
                 try:
-                    os.kill(int(pid.strip()), SIGTERM)
+                    os.kill(int(pid.strip()), signal.SIGTERM)
                 except OSError:
                     pass # XXX report error?
 
                 except OSError:
                     pass # XXX report error?