Commit ff0b37d1 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents 4c47eae2 8c875e01
......@@ -22,11 +22,11 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-frontend]
filename = instance-frontend.cfg.in
md5sum = ae04e2c6137cb5bd5ef1a9b3c6738c49
md5sum = 1ec349747487b45dd6b30bb2aa45acbe
[profile-master]
filename = instance-master.cfg.in
md5sum = 2c599c22f6ab9bf2bbc48da8a12ae6e0
md5sum = 50dbd9bd25fbc608b576ac83f4e13b0f
[profile-slave-list]
filename = instance-slave-list.cfg.in
......@@ -82,15 +82,15 @@ md5sum = 905e395b67c0a2b214b9f0099c8dc939
[template-validate-script]
_update_hash_filename_ = templates/validate-script.sh.in
md5sum = 53e5d7ba2827bff003051f74f24ffe4f
md5sum = ffa38c0110cf7a91cfc514e013b37a6d
[template-configuration-state-script]
_update_hash_filename_ = templates/configuration-state-script.sh.in
md5sum = 4d2537d2698d32a7e909989f8778d144
md5sum = b16a6ebdfc0be3aa7cdeaf47f47751ec
[template-rotate-script]
_update_hash_filename_ = templates/rotate-script.sh.in
md5sum = 8c150e1e6c993708d31936742f3a7302
md5sum = b6fda7e51b6847199c3d142fc3f9a671
[software-setup]
filename = setup.py
......@@ -102,7 +102,7 @@ md5sum = e82ccdb0b26552a1c88ff523d8fae24a
[profile-kedifa]
filename = instance-kedifa.cfg.in
md5sum = 40fe46a1fe653406b18ca46351d195b8
md5sum = d790e23ebf7b07bb245322629d402551
[template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
......
......@@ -644,6 +644,7 @@ pattern = *.old
keep_days = 365
extra-context =
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key log_dir trafficserver-directory:log
key rotate_dir trafficserver-directory:logrotate-backup
key xz_binary :xz_binary
......@@ -669,6 +670,8 @@ path_list = ${caddy-configuration:frontend-configuration} ${caddy-directory:slav
sha256sum = {{ software_parameter_dict['sha256sum'] }}
extra-context =
import os_module os
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key path_list :path_list
key sha256sum :sha256sum
key signature_file :signature_file
......@@ -697,6 +700,7 @@ output = ${directory:bin}/frontend-caddy-validate
last_state_file = ${directory:run}/caddy_configuration_last_state
validate_command = ${caddy-wrapper:output} -validate
extra-context =
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key validate_command :validate_command
key configuration_state_command frontend-caddy-configuration-state-validate:output
key last_state_file :last_state_file
......@@ -832,6 +836,8 @@ path_list = ${backend-haproxy-configuration:file} ${backend-client-login-config:
sha256sum = {{ software_parameter_dict['sha256sum'] }}
extra-context =
import os_module os
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key path_list :path_list
key sha256sum :sha256sum
key signature_file :signature_file
......@@ -860,6 +866,7 @@ output = ${directory:bin}/backend-haproxy-validate
last_state_file = ${directory:run}/backend_haproxy_configuration_last_state
validate_command = {{ software_parameter_dict['haproxy_executable'] }} -f ${backend-haproxy-configuration:file} -c
extra-context =
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key validate_command :validate_command
key configuration_state_command backend-haproxy-configuration-state-validate:output
key last_state_file :last_state_file
......@@ -1001,6 +1008,8 @@ path_list = ${frontend-configuration:slave-introspection-configuration} ${fronte
sha256sum = {{ software_parameter_dict['sha256sum'] }}
extra-context =
import os_module os
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key path_list :path_list
key sha256sum :sha256sum
key signature_file :signature_file
......@@ -1029,6 +1038,7 @@ output = ${directory:bin}/slave-introspection-validate
last_state_file = ${directory:run}/slave_introspection_configuration_last_state
validate_command = {{ software_parameter_dict['nginx'] }} -c ${frontend-configuration:slave-introspection-configuration} -t
extra-context =
raw find_executable {{ software_parameter_dict['findutils'] }}/bin/find
key validate_command :validate_command
key configuration_state_command slave-introspection-configuration-state-validate:output
key last_state_file :last_state_file
......
......@@ -288,7 +288,7 @@ directory = ${directory:auth-ready}
init =
import os
if os.path.isdir(options['directory']):
os.system("find %s -type f -name *-auth-random -size 0 -delete" % (options['directory'],))
os.system("{{ software_parameter_dict['findutils'] }}/bin/find %s -type f -name *-auth-random -size 0 -delete" % (options['directory'],))
[auth-random]
recipe = slapos.recipe.build
......@@ -335,7 +335,7 @@ config-command =
recipe = plone.recipe.command
output = ${directory:var}/${:_buildout_section_name_}.txt
update-command = ${:command}
command = find ${directory:auth-ready} -type f > ${:output}
command = {{ software_parameter_dict['findutils'] }}/bin/find ${directory:auth-ready} -type f > ${:output}
[promise-kedifa-auth-ready]
<= monitor-promise-base
......
......@@ -856,7 +856,7 @@ key = ${:certificate}
stop-on-error = True
update-command = ${:command}
command =
[ -f ${:certificate} ] && find ${:certificate} -type f -mtime +3 -delete
[ -f ${:certificate} ] && {{ software_parameter_dict['findutils'] }}/bin/find ${:certificate} -type f -mtime +3 -delete
if ! [ -f ${:certificate} ] ; then
openssl req -new -newkey rsa:2048 -sha256 -subj \
"/CN=${rejected-slave-publish-configuration:ip}" \
......
......@@ -13,6 +13,7 @@ extends =
../../component/numpy/buildout.cfg
../../component/haproxy/buildout.cfg
../../component/nginx/buildout.cfg
../../component/findutils/buildout.cfg
../../stack/caucase/buildout.cfg
......@@ -125,6 +126,7 @@ xz_location = ${xz-utils:location}
htpasswd = ${:bin_directory}/htpasswd
smart_caucase_signer = ${:bin_directory}/smart-caucase-signer
caucase_csr_sign_check = ${:bin_directory}/caucase-csr-sign-check
findutils = ${findutils:location}
[template]
recipe = slapos.recipe.template:jinja2
......
......@@ -5,7 +5,16 @@ SIGNATURE_FILE={{ signature_file }}
NSIGNATURE_FILE={{ signature_file }}.tmp
touch $SIGNATURE_FILE
{{ sha256sum }} {{ path_list }} 2> /dev/null | sort -k 66 > $NSIGNATURE_FILE
rm -f $NSIGNATURE_FILE $NSIGNATURE_FILE.wrk
set +e
{%- for path in path_list.split() %}
{%- set directory = os_module.path.dirname(path) %}
{%- set name = os_module.path.basename(path) %}
{{ find_executable }} {{ directory }} -type f -name '{{ name }}' -exec {{ sha256sum }} {} \; >> $NSIGNATURE_FILE.wrk
{%- endfor %}
set -e
sort -k 2,2 $NSIGNATURE_FILE.wrk > $NSIGNATURE_FILE
rm -f $NSIGNATURE_FILE.wrk
if diff "$SIGNATURE_FILE" "$NSIGNATURE_FILE" > /dev/null ; then
# No changes since last run just propagate information
......
......@@ -9,10 +9,10 @@ COMPRESS={{ xz_binary }}
KEEP_DAYS={{ keep_days }}
# Move out ${PATTERN} files
find ${LOG_DIR} -maxdepth 1 -type f -name ${PATTERN} -exec mv {} ${LOGROTATE_DIR}/ \;
{{ find_executable }} ${LOG_DIR} -maxdepth 1 -type f -name ${PATTERN} -exec mv {} ${LOGROTATE_DIR}/ \;
# Compress
find ${LOGROTATE_DIR} -maxdepth 1 -type f -name ${PATTERN} -exec ${COMPRESS} -9 {} \;
{{ find_executable }} ${LOGROTATE_DIR} -maxdepth 1 -type f -name ${PATTERN} -exec ${COMPRESS} -9 {} \;
# Retent old files
find ${LOGROTATE_DIR} -maxdepth 1 -type f -mtime +${KEEP_DAYS} -delete
{{ find_executable }} ${LOGROTATE_DIR} -maxdepth 1 -type f -mtime +${KEEP_DAYS} -delete
......@@ -7,7 +7,7 @@ LAST_STATE_FILE={{ last_state_file }}
# force validation each 2 hours
old_found=1
if [ -f $LAST_STATE_FILE ] ; then
old_found=$(find $LAST_STATE_FILE -mmin +120 | wc -l)
old_found=$({{ find_executable }} $LAST_STATE_FILE -mmin +120 | wc -l)
fi
if [ "$old_found" -eq 1 ] || {{ configuration_state_command }} ; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment