def configure(self): self.provide('supervisor', self) buildout_cfg = File('buildout.cfg', source=self.buildout_cfg) self += Buildout('buildout', version='2.9.5', setuptools='36.6.0', config=buildout_cfg, python='2.7') self.program_config_dir = Directory('etc/supervisor.d', leading=True) self += self.program_config_dir self += File('etc/supervisord.conf', source=self.supervisor_conf) self.logdir = Directory('var/log', leading=True) self += self.logdir postrotate = self.expand( 'kill -USR2 $({{component.workdir}}/bin/supervisorctl pid)') if self.logrotate: self += RotatedLogfile('var/log/*.log', postrotate=postrotate) self += Service('bin/supervisord', pidfile=self.pidfile) service = self._ if self.enable: self += RunningSupervisor(service) else: self += StoppedSupervisor(service) # Nagios check if self.nagios: self += File('check_supervisor', mode=0o755, source=os.path.join(os.path.dirname(__file__), 'resources', 'check_supervisor.py.in')) self += ServiceCheck( 'Supervisor programs', nrpe=True, contact_groups=self.check_contact_groups, command=self.expand('{{component.workdir}}/check_supervisor'))
def configure(self): self.provide("supervisor", self) buildout_cfg = File("buildout.cfg", source=self.buildout_cfg) self += Buildout(version="2.13.3", setuptools="50.3.2", config=buildout_cfg, python="3") self.program_config_dir = Directory("etc/supervisor.d", leading=True) self += self.program_config_dir self += File("etc/supervisord.conf", source=self.supervisor_conf) self.logdir = Directory("var/log", leading=True) self += self.logdir postrotate = self.expand( "kill -USR2 $({{component.workdir}}/bin/supervisorctl pid)") if self.logrotate: self += RotatedLogfile("var/log/*.log", postrotate=postrotate) self += Service("bin/supervisord", pidfile=self.pidfile) service = self._ if self.enable: self += RunningSupervisor(service) else: self += StoppedSupervisor() self += File("check_supervisor", mode=0o755, source=os.path.join(os.path.dirname(__file__), "resources", "check_supervisor.py.in")) if self.nagios: self += ServiceCheck( "Supervisor programs", nrpe=True, contact_groups=self.check_contact_groups, command=self.expand("{{component.workdir}}/check_supervisor"))
def test_rebootcronjob(root): service = Service("bobbob") cronjob = RebootCronjob() root.component += service service += cronjob