- self._restore()
-
- @handler('Starts the service')
- def start(self):
- if self.params['prio'] != '':
- call(('/usr/local/bin/vrrpd','-i',self.params['dev'],'-v',self.params['id'],'-p',self.params['prio'],self.params['ipaddress']))
- #print ('vrrpd','-i',self.params['dev'],'-v',self.params['id'],'-p',self.params['prio'],self.params['ipaddress'])
- else:
- 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:
- pass
-
- @handler('Reloads the service')
- def reload(self):
- self.stop()
- self.start()