summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-09-14 13:01:24 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-09-21 11:31:43 -0400
commit9947327e88bc43f187d235c44f79492dfb00bf0f (patch)
treed2e5386ac120d344c111eac5efd2255da68635d1 /etc
parentffdec90b38eadb58f3880a72c6db0c2d6d5c3d6b (diff)
downloadmongo-9947327e88bc43f187d235c44f79492dfb00bf0f.tar.gz
SERVER-36842 Core dump not generated after invariant failure in powercycle hosts
(cherry picked from commit 9f634fbb3b49e1a591f054b097caf862f192f0c2)
Diffstat (limited to 'etc')
-rw-r--r--etc/evergreen.yml58
1 files changed, 58 insertions, 0 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index f02a3bece79..c2ec1b429ef 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -1511,6 +1511,64 @@ functions:
shell: bash
working_dir: src
script: |
+ if [ "Windows_NT" = "$OS" ]; then
+ exit 0
+ fi
+ # Enable core dumps on non-Windows remote hosts.
+ # The core pattern must specify a director, since mongod --fork will chdir("/")
+ # and cannot generate a core dump there (see SERVER-21635).
+ # We need to reboot the host for the core limits to take effect.
+ ${set_sudo}
+ core_pattern=${remote_dir}/dump_%e.%p.core
+ sysctl_conf=/etc/sysctl.conf
+ cmds="ulimit -a"
+ cmds="$cmds; echo \"$USER - core unlimited\" | $sudo tee -a /etc/security/limits.conf"
+ cmds="$cmds; if [ -f $sysctl_conf ]"
+ cmds="$cmds; then grep ^kernel.core_pattern $sysctl_conf"
+ cmds="$cmds; if [ \$? -eq 0 ]"
+ cmds="$cmds; then $sudo sed -i \"s,kernel.core_pattern=.*,kernel.core_pattern=$core_pattern,\" $sysctl_conf"
+ cmds="$cmds; else echo \"kernel.core_pattern=$core_pattern\" | $sudo tee -a $sysctl_conf"
+ cmds="$cmds; fi"
+ cmds="$cmds; else echo Cannot change the core pattern and no core dumps will be generated."
+ cmds="$cmds; fi"
+ cmds="$cmds; $sudo reboot"
+ ssh_connection_options="${ssh_identity} ${ssh_connection_options}"
+ ${activate_virtualenv}
+ $python buildscripts/remote_operations.py \
+ --verbose \
+ --userHost $USER@${private_ip_address} \
+ --sshConnectionOptions "$ssh_connection_options" \
+ --retries ${ssh_retries|0} \
+ --commands "$cmds"
+
+ - command: shell.exec
+ params:
+ shell: bash
+ working_dir: src
+ script: |
+ if [ "Windows_NT" = "$OS" ]; then
+ exit 0
+ fi
+ # Print the ulimit & kernel.core_pattern
+ cmds="uptime"
+ cmds="$cmds; ulimit -a"
+ cmds="$cmds; if [ -f /sbin/sysctl ]"
+ cmds="$cmds; then /sbin/sysctl kernel.core_pattern"
+ cmds="$cmds; fi"
+ ssh_connection_options="${ssh_identity} ${ssh_connection_options}"
+ ${activate_virtualenv}
+ $python buildscripts/remote_operations.py \
+ --verbose \
+ --userHost $USER@${private_ip_address} \
+ --sshConnectionOptions "$ssh_connection_options" \
+ --retries ${ssh_retries|3} \
+ --commands "$cmds"
+
+ - command: shell.exec
+ params:
+ shell: bash
+ working_dir: src
+ script: |
set -o errexit
${activate_virtualenv}
${set_sudo}