on all distributions
OpenSUSE does not automatically add the | back when setting
the corepattern. I tested this on openSUSE Leap 15.0.
Fixes: http://tracker.ceph.com/issues/38325
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit
bc2df8c49b17248cc832deae75149d8e26d3f1e7)
function cleanup() {
if [ -n "$precore" ]; then
- sudo sysctl -w ${KERNCORE}=${precore}
+ sudo sysctl -w "${KERNCORE}=${precore}"
fi
}
if [ "$precore" = "$COREPATTERN" ]; then
precore=""
else
- sudo sysctl -w ${KERNCORE}=${COREPATTERN}
+ sudo sysctl -w "${KERNCORE}=${COREPATTERN}"
fi
# Clean out any cores in core target directory (currently .)
if ls $(dirname $(sysctl -n $KERNCORE)) | grep -q '^core\|core$' ; then