Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aurel
slapos
Commits
2836a9b0
Commit
2836a9b0
authored
Oct 08, 2018
by
Guillaume Hervier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/logrotate: auto-restart services on SR upgrade.
parent
e15a7686
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
software/monitor/test/test.py
software/monitor/test/test.py
+5
-4
stack/logrotate/buildout.hash.cfg
stack/logrotate/buildout.hash.cfg
+1
-1
stack/logrotate/instance-logrotate-base.cfg.in
stack/logrotate/instance-logrotate-base.cfg.in
+12
-2
No files found.
software/monitor/test/test.py
View file @
2836a9b0
...
@@ -70,8 +70,9 @@ class ServicesTestCase(InstanceTestCase):
...
@@ -70,8 +70,9 @@ class ServicesTestCase(InstanceTestCase):
hash_files
=
[
hash_files
=
[
'software_release/buildout.cfg'
,
'software_release/buildout.cfg'
,
]
]
service_names
=
[
expected_process_names
=
[
'monitor-httpd'
,
'monitor-httpd-{hash}-on-watch'
,
'crond-{hash}'
,
]
]
supervisor
=
self
.
getSupervisorRPCServer
().
supervisor
supervisor
=
self
.
getSupervisorRPCServer
().
supervisor
...
@@ -81,8 +82,8 @@ class ServicesTestCase(InstanceTestCase):
...
@@ -81,8 +82,8 @@ class ServicesTestCase(InstanceTestCase):
hash_files
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
hash_files
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
for
path
in
hash_files
]
for
path
in
hash_files
]
for
service_name
in
service
_names
:
for
name
in
expected_process
_names
:
h
=
ServicesTestCase
.
generateHashFromFiles
(
hash_files
)
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
)
self
.
assertIn
(
expected_process_name
,
process_names
)
stack/logrotate/buildout.hash.cfg
View file @
2836a9b0
...
@@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e
...
@@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e
[template-logrotate-base]
[template-logrotate-base]
filename = instance-logrotate-base.cfg.in
filename = instance-logrotate-base.cfg.in
md5sum =
9f44fc5ee22c6662297b41f71fa11b7c
md5sum =
f56b86a0742afff931a5e972114566e4
stack/logrotate/instance-logrotate-base.cfg.in
View file @
2836a9b0
[buildout]
[buildout]
parts =
parts =
cron-service
cron-entry-logrotate
cron-entry-logrotate
logrotate-entry-cron
logrotate-entry-cron
...
@@ -10,7 +11,16 @@ dcrond-binary = {{ dcron_location }}/sbin/crond
...
@@ -10,7 +11,16 @@ dcrond-binary = {{ dcron_location }}/sbin/crond
crontabs = ${logrotate-directory:crontabs}
crontabs = ${logrotate-directory:crontabs}
cronstamps = ${logrotate-directory:cronstamps}
cronstamps = ${logrotate-directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
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]
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
recipe = slapos.cookbook:simplelogger
...
@@ -51,7 +61,7 @@ post =
...
@@ -51,7 +61,7 @@ post =
pre =
pre =
frequency = daily
frequency = daily
rotate-num = 3650
rotate-num = 3650
nocompress =
nocompress =
[logrotate]
[logrotate]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment