Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make create-swapfile.sh more verbose
Last time I've see it fail, it was: 2022/10/02 04:08:05 create-swapfile.sh | sh: 1: /tmp/script/create-swapfile.sh: Cannot allocate memory 2022/10/02 04:08:05 Action `Create a swap file` failed at stage Run, error: exit status 126 First line indicates that fallocate failed. Fine. But then the code should have gone through the retry loop, and it should have either fail again, or succeed. In any case, there should be some logs on stdout or stderr. Instead the script returned with 126. At a first glance, it means: > If a command is found but is not executable, the return status is 126 > -- https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html But, wait, wrong. This is bash. However the script create-swapfile.sh runs with shebang /bin/sh, which is a symlink to dash. Looking into dash source code, we see: /* Map to POSIX errors */ switch (e) { default: exerrno = 126; break; case ELOOP: case ENAMETOOLONG: case ENOENT: case ENOTDIR: exerrno = 127; break; } exitstatus = exerrno; Seems like any unexpected error gets mappe to 126, so we don't really know what happens. Let's just be more verbose and see if it can help to troubleshoot this issue.
- Loading branch information