diff --git a/scripts/cloudron-support b/scripts/cloudron-support index b633922e2..f34881adf 100755 --- a/scripts/cloudron-support +++ b/scripts/cloudron-support @@ -125,7 +125,9 @@ function send_diagnostics() { fi echo -e $LINE"Filesystem stats"$LINE >> $log - df -h &>> $log + if ! timeout --kill-after 10s 15s df -h &>> $log 2>&1; then + echo -e "df is not responding" >> $log + fi echo -e $LINE"Appsdata stats"$LINE >> $log du -hcsL /home/yellowtent/appsdata/* &>> $log || true diff --git a/src/df.js b/src/df.js index 0bb9938c0..233b5590d 100644 --- a/src/df.js +++ b/src/df.js @@ -37,7 +37,7 @@ function parseLine(line) { } async function disks() { - const [error, output] = await safe(shell.promises.exec('disks', 'df -B1 --output=source,fstype,size,used,avail,pcent,target', {})); + const [error, output] = await safe(shell.promises.exec('disks', 'df -B1 --output=source,fstype,size,used,avail,pcent,target', { timeout: 5000 })); if (error) { debug(`disks: df command failed. error: ${error}\n stdout: ${error.stdout}\n stderr: ${error.stderr}`); throw new BoxError(BoxError.FS_ERROR, `Error running df: ${error.message}`); @@ -54,7 +54,7 @@ async function disks() { async function file(filename) { assert.strictEqual(typeof filename, 'string'); - const [error, output] = await safe(shell.promises.exec('file', `df -B1 --output=source,fstype,size,used,avail,pcent,target ${filename}`, {})); + const [error, output] = await safe(shell.promises.exec('file', `df -B1 --output=source,fstype,size,used,avail,pcent,target ${filename}`, { timeout: 5000 })); if (error) { debug(`file: df command failed. error: ${error}\n stdout: ${error.stdout}\n stderr: ${error.stderr}`); throw new BoxError(BoxError.FS_ERROR, `Error running df: ${error.message}`);