diff --git a/software/monitor/test/test.py b/software/monitor/test/test.py index 42b59e73374f9304758cd98840e0c38ab2c8e5d4..21e8d1a95152fb7f2abb6750f67e0ea21e6219c7 100644 --- a/software/monitor/test/test.py +++ b/software/monitor/test/test.py @@ -70,8 +70,9 @@ class ServicesTestCase(InstanceTestCase): hash_files = [ 'software_release/buildout.cfg', ] - service_names = [ - 'monitor-httpd', + expected_process_names = [ + 'monitor-httpd-{hash}-on-watch', + 'crond-{hash}', ] supervisor = self.getSupervisorRPCServer().supervisor @@ -81,8 +82,8 @@ class ServicesTestCase(InstanceTestCase): hash_files = [os.path.join(self.computer_partition_root_path, path) for path in hash_files] - for service_name in service_names: + for name in expected_process_names: h = ServicesTestCase.generateHashFromFiles(hash_files) - expected_process_name = '{}-{}-on-watch'.format(service_name, h) + expected_process_name = name.format(hash=h) self.assertIn(expected_process_name, process_names) diff --git a/stack/logrotate/buildout.hash.cfg b/stack/logrotate/buildout.hash.cfg index afbfc203b3a528d8a9dff9dddf10ac0bcf0a88a1..11e356047b7be8bff888dbeee353ce95dda65fcb 100644 --- a/stack/logrotate/buildout.hash.cfg +++ b/stack/logrotate/buildout.hash.cfg @@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e [template-logrotate-base] filename = instance-logrotate-base.cfg.in -md5sum = 9f44fc5ee22c6662297b41f71fa11b7c +md5sum = f56b86a0742afff931a5e972114566e4 diff --git a/stack/logrotate/instance-logrotate-base.cfg.in b/stack/logrotate/instance-logrotate-base.cfg.in index 452696702efe62e92f269785ff7d9d3d5c61cc44..c729e0e9a329c958baa29e6235d981cb3d1292e5 100644 --- a/stack/logrotate/instance-logrotate-base.cfg.in +++ b/stack/logrotate/instance-logrotate-base.cfg.in @@ -1,5 +1,6 @@ [buildout] parts = + cron-service cron-entry-logrotate logrotate-entry-cron @@ -10,7 +11,16 @@ dcrond-binary = {{ dcron_location }}/sbin/crond crontabs = ${logrotate-directory:crontabs} cronstamps = ${logrotate-directory:cronstamps} catcher = ${cron-simplelogger:wrapper} -binary = ${logrotate-directory:services}/crond +binary = ${logrotate-directory:bin}/crond +# This is here so to keep backward compatibility where the cron +# section should create the service too and keep variables here +service = ${cron-service:wrapper-path} + +[cron-service] +recipe = slapos.cookbook:wrapper +command-line = ${cron:binary} +wrapper-path = ${logrotate-directory:services}/crond +hash-files = ${buildout:directory}/software_release/buildout.cfg [cron-simplelogger] recipe = slapos.cookbook:simplelogger @@ -51,7 +61,7 @@ post = pre = frequency = daily rotate-num = 3650 -nocompress = +nocompress = [logrotate] recipe = slapos.cookbook:wrapper