status: fix false DRIFT for non-root invocations
- runner: export sbin-inclusive PATH (util-linux tools live in /usr/sbin) - 001: read /proc/swaps instead of swapon(8) - 005: resolve /dev/disk/by-uuid symlink instead of findfs(8); report ? (exit 2) when the UUID cannot be resolved
This commit is contained in:
@@ -26,8 +26,7 @@ case "${1:-}" in
|
||||
echo " swap 2GB enabled + fstab entry + vm.swappiness=10"
|
||||
;;
|
||||
status)
|
||||
swapon --show --noheadings 2>/dev/null | grep -q '^/swapfile ' \
|
||||
|| { echo "DRIFT /swapfile not active"; exit 1; }
|
||||
grep -q '^/swapfile ' /proc/swaps || { echo "DRIFT /swapfile not active"; exit 1; }
|
||||
grep -q '^/swapfile ' /etc/fstab || { echo "DRIFT fstab entry missing"; exit 1; }
|
||||
swp=$(cat /proc/sys/vm/swappiness 2>/dev/null || echo '?')
|
||||
[[ $swp == 10 ]] || { echo "DRIFT vm.swappiness=$swp (want 10)"; exit 1; }
|
||||
|
||||
Reference in New Issue
Block a user