generic/228: fix restoration of kernel.core_pattern sysctl
authorOmar Sandoval <osandov@fb.com>
Thu, 9 Aug 2018 21:40:12 +0000 (14:40 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Aug 2018 12:05:42 +0000 (20:05 +0800)
commited6826096002fa8e6b35fd4e33c746dc60b0d8f5
tree2412cdfcc8c27536dd0d1ab14f7ed4b7d80d7912
parentaa0b82a9fd976ca50fba25c12461a7f3dd7af102
generic/228: fix restoration of kernel.core_pattern sysctl

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>
tests/generic/228