Skip to content

Commit

Permalink
generic/228: fix restoration of kernel.core_pattern sysctl
Browse files Browse the repository at this point in the history
generic/228 changes kernel.core_pattern, so it saves it beforehand in
order to restore it. However, it adds an extra space in the process:

$ echo \"$(sysctl kernel.core_pattern | awk -F = '{print $NF}')\"
" |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e"

Instead of using awk, just use sysctl -n to only print the value.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
  • Loading branch information
osandov authored and guaneryu committed Aug 12, 2018
1 parent aa0b82a commit ed68260
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/generic/228
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ avail=`df -P $TEST_DIR | awk 'END {print $4}'`
[ "$avail" -ge 104000 ] || _notrun "Test device is too small ($avail KiB)"

# Suppress core dumped messages
core_pattern=`sysctl kernel.core_pattern | awk -F = '{print $NF}'`
core_pattern=`sysctl -n kernel.core_pattern`
ulimit_c=`ulimit -c`
sysctl -w kernel.core_pattern=core &>/dev/null
ulimit -c 0
Expand Down

0 comments on commit ed68260

Please sign in to comment.