From c3968cf1c66a76872c528bf00e8a8556d06592c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Fri, 25 Sep 2020 11:47:38 +0200 Subject: [PATCH] Use truncate --no-create --size=0 to truncate files This avoids the permission error due to /proc/sys/fs/protected_regular = 2 setting which is now enabled by default in bullseye. --- share/hooks/normal/0140-remove-log-files.hook.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/hooks/normal/0140-remove-log-files.hook.chroot b/share/hooks/normal/0140-remove-log-files.hook.chroot index f95e54686..b3d1c9e22 100755 --- a/share/hooks/normal/0140-remove-log-files.hook.chroot +++ b/share/hooks/normal/0140-remove-log-files.hook.chroot @@ -5,5 +5,5 @@ set -e # Truncate log files for _FILE in $(find /var/log/ -type f) do - : > ${_FILE} + truncate --no-create --size=0 ${_FILE} done