Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
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):
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
)
stack/logrotate/buildout.hash.cfg
View file @
2836a9b0
...
...
@@ -22,4 +22,4 @@ md5sum = 117e46af6d9d31c09eeb86089d11407e
[template-logrotate-base]
filename = instance-logrotate-base.cfg.in
md5sum =
9f44fc5ee22c6662297b41f71fa11b7c
md5sum =
f56b86a0742afff931a5e972114566e4
stack/logrotate/instance-logrotate-base.cfg.in
View file @
2836a9b0
[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
...
...
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