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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
08f2b352
Commit
08f2b352
authored
Oct 19, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'erp5-generic' of
http://git.erp5.org/repos/slapos
into erp5-generic
parents
4d6144f4
c0d260d6
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
75 deletions
+25
-75
slapos/recipe/dcron.py
slapos/recipe/dcron.py
+2
-5
slapos/recipe/logrotate.py
slapos/recipe/logrotate.py
+19
-51
software/erp5/instance-kumofs.cfg
software/erp5/instance-kumofs.cfg
+1
-6
software/erp5/instance-mariadb.cfg
software/erp5/instance-mariadb.cfg
+0
-5
software/erp5/snippet-backend.cfg
software/erp5/snippet-backend.cfg
+1
-1
software/erp5/snippet-master.cfg
software/erp5/snippet-master.cfg
+0
-5
software/erp5/software.cfg
software/erp5/software.cfg
+2
-2
No files found.
slapos/recipe/dcron.py
View file @
08f2b352
...
...
@@ -58,13 +58,10 @@ class Recipe(GenericBaseRecipe):
class
Part
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
if
'name'
not
in
options
:
options
[
'name'
]
=
self
.
name
def
install
(
self
):
cron_d
=
self
.
options
[
'cron-entries'
]
filename
=
os
.
path
.
join
(
cron_d
,
'name'
)
name
=
self
.
options
[
'name'
]
filename
=
os
.
path
.
join
(
cron_d
,
name
)
with
open
(
filename
,
'w'
)
as
part
:
part
.
write
(
'%(frequency)s %(command)s
\
n
'
%
{
...
...
slapos/recipe/logrotate.py
View file @
08f2b352
...
...
@@ -30,39 +30,28 @@ from slapos.recipe.librecipe import GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
if
'name'
not
in
options
:
options
[
'name'
]
=
self
.
name
def
install
(
self
):
path_list
=
[]
logrotate_backup
=
self
.
options
[
'backup'
]
logrotate_d
=
self
.
options
[
'logrotate-entries'
]
logrotate_conf_file
=
self
.
options
[
'conf'
]
logrotate_conf
=
[]
logrotate_conf
.
append
(
"include %s"
%
logrotate_d
)
logrotate_conf
.
append
(
"olddir %s"
%
logrotate_backup
)
logrotate_conf
.
append
(
"dateext"
)
frequency
=
'daily'
if
'frequency'
in
self
.
options
:
frequency
=
self
.
options
[
'frequency'
]
logrotate_conf
.
append
(
frequency
)
num_rotate
=
3650
if
'num-rotate'
in
self
.
options
:
num_rotate
=
self
.
options
[
'num-rotate'
]
logrotate_conf
.
append
(
"rotate %s"
%
num_rotate
)
logrotate_conf
.
append
(
"compress"
)
logrotate_conf
.
append
(
"compresscmd %s"
%
self
.
options
[
'gzip-binary'
])
logrotate_conf
.
append
(
"compressoptions -9"
)
logrotate_conf
.
append
(
"uncompresscmd %s"
%
self
.
options
[
'gunzip-binary'
])
logrotate_conf_file
=
self
.
createFile
(
logrotate_conf_file
,
'
\
n
'
.
join
(
logrotate_conf
))
logrotate_conf
.
append
(
logrotate_conf_file
)
logrotate_conf
=
[
'daily'
,
'dateext'
,
'rotate 3650'
,
'compress'
,
'compresscmd %s'
%
self
.
options
[
'gzip-binary'
],
'compressoptions -9'
,
'uncompresscmd %s'
%
self
.
options
[
'gunzip-binary'
],
'notifempty'
,
'sharedscripts'
,
'create'
,
'include %s'
%
logrotate_d
,
'olddir %s'
%
logrotate_backup
,
]
logrotate_conf_file
=
self
.
createFile
(
logrotate_conf_file
,
'
\
n
'
.
join
(
logrotate_conf
))
state_file
=
self
.
options
[
'state-file'
]
...
...
@@ -71,46 +60,25 @@ class Recipe(GenericBaseRecipe):
'slapos.recipe.librecipe.exceute.execute'
,
[
self
.
options
[
'logrotate-binary'
],
'-s'
,
state_file
,
logrotate_conf_file
,
]
)
path_list
.
append
(
logrotate
)
return
path_list
return
[
logrotate
,
logrotate_conf_file
]
class
Part
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
if
'name'
not
in
options
:
options
[
'name'
]
=
self
.
name
def
install
(
self
):
logrotate_d
=
self
.
options
[
'logrotate-entries'
]
part_path
=
os
.
path
.
join
(
logrotate_d
,
self
.
options
[
'name'
])
conf
=
[]
if
'frequency'
in
self
.
options
:
conf
.
append
(
self
.
options
[
'frequency'
])
if
'num-rotate'
in
self
.
options
:
conf
.
append
(
'rotate %s'
%
self
.
options
[
'num-rotate'
])
if
'post'
in
self
.
options
:
conf
.
append
(
"postrotate
\
n
%s
\
n
endscript"
%
self
.
options
[
'post'
])
if
'pre'
in
self
.
options
:
conf
.
append
(
"prerotate
\
n
%s
\
n
endscript"
%
self
.
options
[
'pre'
])
if
self
.
optionIsTrue
(
'sharedscripts'
,
False
):
conf
.
append
(
"sharedscripts"
)
if
self
.
optionIsTrue
(
'notifempty'
,
False
):
conf
.
append
(
'notifempty'
)
if
self
.
optionIsTrue
(
'create'
,
True
):
conf
.
append
(
'create'
)
log
=
self
.
options
[
'log'
]
self
.
createFile
(
os
.
path
.
join
(
logrotate_d
,
self
.
options
[
'name'
]),
part_path
=
self
.
createFile
(
os
.
path
.
join
(
logrotate_d
,
self
.
options
[
'name'
]),
"%(logfiles)s {
\
n
%(conf)s
\
n
}"
%
{
'logfiles'
:
log
,
'conf'
:
'
\
n
'
.
join
(
conf
),
...
...
software/erp5/instance-kumofs.cfg
View file @
08f2b352
...
...
@@ -46,14 +46,9 @@ kumo-server-binary = ${kumo:location}/bin/kumo-server
[logrotate-entry-kumofs]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name =
mariadb
name =
kumofs
log = $${kumofs-instance:kumo-gateway-log} $${kumofs-instance:kumo-manager-log}
$${kumofs-instance:kumo-server-log}
frequency = daily
rotate-num = 30
sharedscripts = true
notifempty = true
create = true
# rest of parts are candidates for some generic stuff
...
...
software/erp5/instance-mariadb.cfg
View file @
08f2b352
...
...
@@ -89,12 +89,7 @@ state-file = $${rootdirectory:srv}/logrotate.status
recipe = slapos.cookbook:logrotate.d
name = mariadb
log = $${mariadb-instance:error-log} $${mariadb-instance:slow-query-log}
frequency = daily
rotate-num = 30
post = $${mariadb-instance:mysql-binary} --no-defaults -B --socket=$${mariadb-instance:socket} -e "FLUSH LOGS"
sharedscripts = true
notifempty = true
create = true
[cron]
recipe = slapos.cookbook:cron
...
...
software/erp5/snippet-backend.cfg
View file @
08f2b352
...
...
@@ -25,7 +25,7 @@ wrapper = $${basedirectory:services}/apache-%(backend_name)s
[logrotate-entry-apache-%(backend_name)s]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name =
zope
name =
apache-%(backend_name)s
log = $${apache-%(backend_name)s:error-log} $${apache-%(backend_name)s:access-log}
post = ${buildout:bin-directory}/killpidfromfile $${apache-%(backend_name)s:pid-file} SIGUSR1
...
...
software/erp5/snippet-master.cfg
View file @
08f2b352
...
...
@@ -100,11 +100,6 @@ conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status
frequency = daily
rotate-num = 3650
sharedscripts = true
notifempty = true
create = true
[zeo-instance-entry-common]
recipe = slapos.cookbook:zeo
...
...
software/erp5/software.cfg
View file @
08f2b352
...
...
@@ -23,7 +23,7 @@ unzip = true
[template-mariadb]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb.cfg
md5sum =
9c8517900877ce43af64ef6db28fc520
md5sum =
02bac3aec28226f4e7c2398bd454e8a8
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
...
...
@@ -44,7 +44,7 @@ mode = 0644
[template-kumofs]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-kumofs.cfg
md5sum =
d8a4a1976f4d22fae0668be0543438cc
md5sum =
9ba8a7f8eb67c51979b38602bb6610b8
output = ${buildout:directory}/template-kumofs.cfg
mode = 0644
...
...
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