Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entrypoint): dump cores on persistent location #283

Merged
merged 1 commit into from
Jan 3, 2020

Conversation

vishnuitta
Copy link

This is continuation to #282

In this PR, on enabling coredumps, coredumps gets collected onto hostpath "/var/openebs/sparse" which is persistent storage.

Without any directory set in core pattern, core dumps gets collected to the CWD of the shell from which child process got started.

Tested with command like: docker run --env ENABLE_COREDUMP=1 --mount 'type=bind,src=/home/vitta/Desktop,dst=/var/openebs/sparse' openebs/cstor-pool:ulimit5

Signed-off-by: Vitta vitta@mayadata.io

Signed-off-by: Vitta <vitta@mayadata.io>
else
echo "Enabling coredumps"
ulimit -c unlimited
cd /var/openebs/sparse || exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should return non-zero value if sparse directory doesn't exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ help exit
exit: exit [n]
Exit the shell.

Exits the shell with a status of N.  If N is omitted, the exit status
is that of the last command executed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it returns error 2 in this case 'no such file or directory'

vitta@vitta-laptop:~$ sudo docker run --env ENABLE_COREDUMP=1 --mount 'type=bind,src=/home/vitta/Desktop,dst=/home/core' openebs/cstor-pool:ulimit5
Enabling coredumps
at call_exit..
exit code: 0
reference:  /usr/local/bin/entrypoint-poolimage.sh
/usr/local/bin/entrypoint-poolimage.sh: 25: cd: can't cd to /var/openebs/sparse
vitta@vitta-laptop:~$ echo $?
2

Copy link
Member

@pawanpraka1 pawanpraka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@pawanpraka1 pawanpraka1 merged commit 865063a into mayadata-io:develop Jan 3, 2020
@kmova kmova added this to the 1.6.0 milestone Jan 10, 2020
@vishnuitta
Copy link
Author

Environment variable ENABLE_COREDUMP has been added to cStor pool container to control whether cores need to be dumped in case of process crashes. By default, dumping cores will be disabled.
Make sure this environment variable is not enabled if mountPoint of SparseDir has been changed in CAS Templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants