Skip to content

Commit

Permalink
dist: add workaround to capture coredump during system reboot or shut…
Browse files Browse the repository at this point in the history
…down

We found that systemd-coredump does not correctly capturing coredump
during system reboot or shutdown.
As a workaround of this issue, set coredump file path to
kernel.core_pattern during system reboot or shutdown.
It will save core to /var/tmp/core.scylla.$PID.$TIMESTAMP.

Fixes scylladb/scylla-machine-image#436
  • Loading branch information
syuu1228 committed Jul 4, 2023
1 parent 1ab2bb6 commit cf35d70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dist/common/scripts/scylla_kill
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

st_jobs=$(systemctl list-jobs --no-pager shutdown.target)
if [[ ! $st_jobs =~ (^No jobs .*\.$) ]]; then
sysctl -w kernel.core_pattern=/var/tmp/core.%e.%p.%t
fi
pkill scylla
1 change: 1 addition & 0 deletions dist/common/systemd/scylla-server.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ EnvironmentFile=/etc/sysconfig/scylla-server
EnvironmentFile=/etc/scylla.d/*.conf
ExecStartPre=/opt/scylladb/scripts/scylla_prepare
ExecStart=/usr/bin/scylla $SCYLLA_ARGS $SEASTAR_IO $DEV_MODE $CPUSET $MEM_CONF
ExecStop=/opt/scylladb/scripts/scylla_kill
ExecStopPost=/opt/scylladb/scripts/scylla_stop
TimeoutStartSec=1y
TimeoutStopSec=900
Expand Down

0 comments on commit cf35d70

Please sign in to comment.