| Server IP : 172.67.191.97 / Your IP : 104.23.243.197 Web Server : Apache/2.4.63 (Ubuntu) System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.4.5 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/kdump-tools/ |
Upload File : |
#!/bin/sh
KDUMP_DIR="/var/lib/kdump"
if [ ! -x "$(command -v systemctl)" ]; then
echo "Couldn't find systemctl" 1>&2
exit 1
fi
# Notice that memory estimation would only be useful and represent the reality
# if a /proc/meminfo snapshot is collected early on boot, hence we have the
# check below - basically, we shouldn't collect the snapshot in case this
# is executed later by the users (manually or via restarting kdump-tools).
if ! systemctl is-active basic.target 1>/dev/null 2>&1; then
# It's very likely this directory is already created, but if for some
# reason it isn't, we will fail the memory estimator. So, create the
# directory anyway - if it's already there, then this is a NOP.
mkdir -p "${KDUMP_DIR}"
cat /proc/meminfo 1> "${KDUMP_DIR}/mem-$(uname -r)"
fi