- call(('/usr/local/bin/vrrpd','-i',self.params['dev'],'-v',self.params['id'],self.params['ipaddress']))
- #print ('vrrpd','-i',self.params['dev'],'-v',self.params['id'],self.params['ipaddress'])
-
- @handler('Stop the service')
- def stop(self):
- try :
- pid = 'vrrpd' + '_' + self.params['dev'] + '_' + self.params['id'] + '.pid'
- f = file(path.join(self._pid_dir, pid ), 'r')
- call(('kill',f.read().strip('\n')))
- #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