浏览代码

Disable core dumps

Bob Mottram 8 年前
父节点
当前提交
396b202982
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11
    0
      src/freedombone-utils-setup

+ 11
- 0
src/freedombone-utils-setup 查看文件

@@ -458,6 +458,14 @@ function set_command_file_permissions {
458 458
     chown root:root /etc/sudoers
459 459
 }
460 460
 
461
+function disable_core_dumps {
462
+    if ! grep '* hard core 0' /etc/security/limits.conf; then
463
+        echo '* hard core 0' >> /etc/security/limits.conf
464
+    else
465
+        sed -i 's|hard core.*|hard core 0|g' /etc/security/limits.conf
466
+    fi
467
+}
468
+
461 469
 function setup_firewall {
462 470
     function_check create_completion_file
463 471
     create_completion_file
@@ -482,6 +490,9 @@ function setup_utils {
482 490
     read_config_param "PROJECT_REPO"
483 491
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
484 492
 
493
+    function_check disable_core_dumps
494
+    disable_core_dumps
495
+
485 496
     function_check remove_serial_logins
486 497
     remove_serial_logins
487 498