set_core.sh 423 字节
Newer Older
H
Hui Li 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/bash
#
# This file is used to set config for core when taosd crash

set -e
# set -x

csudo=""
if command -v sudo > /dev/null; then
  csudo="sudo"
fi

#ulimit -c unlimited
${csudo} echo "ulimit -c unlimited" >> /etc/profile
source /etc/profile

${csudo} mkdir -p /coredump
${csudo} sysctl -w kernel.core_pattern='/coredump/core-%e-%p'
${csudo} echo '/coredump/core-%e-%p' | ${csudo} tee /proc/sys/kernel/core_pattern