If, by default, a user's PATH does not contain /sbin and /usr/sbin, we
may have a hard time finding sysctl to adjust the kernel core pattern.
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
At least verified in openSUSE tumbleweed and ubuntu 16.04,
`sysctl -n kernel.core_pattern` returns a pipe at the start of the
value. We reset core_pattern to its original form once the script is
about to end, but if we do not discard the pipe the new value will
contain an extra pipe (apparently, the pipe is added automatically at
some point, possibly simply on read). We are simply stripping it on
read, as to prevent this behavior.
Additionally, we are also enclosing the reset of kernel.core_pattern in
quotes, so as to make sure patterns that include spaces (e.g., ubuntu's
apport, or tumbleweed's systemd-coredump) are properly reset.
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
otherwise ceph-mgr will refuse to start if the required python binding,
a.k.a mgr_module is not available in default sys.path.
Signed-off-by: Kefu Chai <kchai@redhat.com>
If sudo requires a password it is nice to be able to avoid
sudo sysctl by setting core_pattern ahead of time.
Signed-off-by: David Zafman <dzafman@redhat.com>