- #call(('vrrp','-i',self.params[dev],'-v',self.params[id],self.params[ipaddress]))
- print ('vrrp','-i',self.params['dev'],'-v',self.params['id'],self.params['ipaddress'])
-
- @handler('Stop the service')
- def stop(self):
- try :
- f = file(path.join(self._pid_dir, pid_filename ), 'r')
- #call(('kill','<',f.read()))
- print(('kill','<',f.read()))
- except IOError:
+ call(('vrrp', '-i', self.params['dev'], '-v', self.params['id'], \
+ self.params['ipaddress']))
+
+ def _service_stop(self):
+ try:
+ pid_filename = 'vrrpd_%(dev)s_%(id)s.pid' % self.params
+ pid = file(path.join(self._pid_dir, pid_filename )).read().strip()
+ os.kill(int(pid), SIGTERM)
+ except (IOError, OSError):
+ # TODO log