summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskovaleff <sk607s@att.com>2018-11-02 11:36:39 -0700
committerAnderson, Craig (ca846m) <craig.anderson@att.com>2018-11-02 12:37:29 -0700
commiteebedea5f2fb70c73851f94da4dfd71586236a23 (patch)
tree4884585fcddbc5059000c45baad44d93968cbaef
parent7ed8c29f99d5acb51a63b6bdb7c4a5f86c9b4245 (diff)
Make specific module internal filenames for limits
Avoid filename collision between limits and sysctl module. Bugfix for sysctl to print reverted setting before it's deleted. Change-Id: I31269c413f884a25ecf3588b52677ca427b4c082
Notes
Notes (review): Code-Review+2: Craig Anderson <craig.anderson@att.com> Workflow+1: Craig Anderson <craig.anderson@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 02 Nov 2018 21:10:39 +0000 Reviewed-on: https://review.openstack.org/615283 Project: openstack/airship-divingbell Branch: refs/heads/master
-rw-r--r--divingbell/templates/bin/_limits.sh.tpl10
-rw-r--r--divingbell/templates/bin/_sysctl.sh.tpl4
2 files changed, 7 insertions, 7 deletions
diff --git a/divingbell/templates/bin/_limits.sh.tpl b/divingbell/templates/bin/_limits.sh.tpl
index 3e8f4e3..0776fdd 100644
--- a/divingbell/templates/bin/_limits.sh.tpl
+++ b/divingbell/templates/bin/_limits.sh.tpl
@@ -57,7 +57,7 @@ add_limits_param(){
57 log.INFO "No changes made to limits param: ${limit}" 57 log.INFO "No changes made to limits param: ${limit}"
58 fi 58 fi
59 59
60 curr_settings="${curr_settings}${file_name}"$'\n' 60 curr_limits="${curr_limits}${file_name}"$'\n'
61} 61}
62 62
63{{- range $index, $limit := .Values.conf.limits }} 63{{- range $index, $limit := .Values.conf.limits }}
@@ -68,9 +68,9 @@ add_limits_param {{ $index | squote }} {{ $limit.domain | squote }} {{ $limit.ty
68# Revert any previously applied limits settings which are now absent 68# Revert any previously applied limits settings which are now absent
69prev_files="$(find "${persist_path}" -type f)" 69prev_files="$(find "${persist_path}" -type f)"
70if [ -n "${prev_files}" ]; then 70if [ -n "${prev_files}" ]; then
71 basename -a ${prev_files} | sort > /tmp/prev_settings 71 basename -a ${prev_files} | sort > /tmp/prev_limits
72 echo "${curr_settings}" | sort > /tmp/curr_settings 72 echo "${curr_limits}" | sort > /tmp/curr_limits
73 revert_list="$(comm -23 /tmp/prev_settings /tmp/curr_settings)" 73 revert_list="$(comm -23 /tmp/prev_limits /tmp/curr_limits)"
74 IFS=$'\n' 74 IFS=$'\n'
75 for orig_limits_setting in ${revert_list}; do 75 for orig_limits_setting in ${revert_list}; do
76 rm "${persist_path}/${orig_limits_setting}" 76 rm "${persist_path}/${orig_limits_setting}"
@@ -87,7 +87,7 @@ su -c "prlimit --noheadings --output RESOURCE,SOFT,HARD"
87# For this test it's just test bash process. 87# For this test it's just test bash process.
88# For production case it's limits_host.sh run by DivingBell pod which is in sleep mode. 88# For production case it's limits_host.sh run by DivingBell pod which is in sleep mode.
89 89
90if [ -n "${curr_settings}" ]; then 90if [ -n "${curr_limits}" ]; then
91 log.INFO 'All limits configuration successfully validated on this node.' 91 log.INFO 'All limits configuration successfully validated on this node.'
92else 92else
93 log.WARN 'No limits overrides defined for this node.' 93 log.WARN 'No limits overrides defined for this node.'
diff --git a/divingbell/templates/bin/_sysctl.sh.tpl b/divingbell/templates/bin/_sysctl.sh.tpl
index 5a6d0d1..064f68b 100644
--- a/divingbell/templates/bin/_sysctl.sh.tpl
+++ b/divingbell/templates/bin/_sysctl.sh.tpl
@@ -103,10 +103,10 @@ if [ -n "${prev_files}" ]; then
103 for orig_sysctl_setting in ${revert_list}; do 103 for orig_sysctl_setting in ${revert_list}; do
104 rm "${persist_path}/${orig_sysctl_setting}" 104 rm "${persist_path}/${orig_sysctl_setting}"
105 sysctl -p "${defaults_path}/${orig_sysctl_setting}" 105 sysctl -p "${defaults_path}/${orig_sysctl_setting}"
106 rm "${defaults_path}/${orig_sysctl_setting}"
107 reload_system_configs=true
108 log.INFO "Reverted sysctl setting:" \ 106 log.INFO "Reverted sysctl setting:" \
109 "$(cat "${defaults_path}/${orig_sysctl_setting}")" 107 "$(cat "${defaults_path}/${orig_sysctl_setting}")"
108 rm "${defaults_path}/${orig_sysctl_setting}"
109 reload_system_configs=true
110 done 110 done
111fi 111fi
112 112