summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Hertzog <raphael@offensive-security.com>2020-09-25 11:47:38 +0200
committerRaphaël Hertzog <raphael@offensive-security.com>2020-09-25 11:49:03 +0200
commitc3968cf1c66a76872c528bf00e8a8556d06592c7 (patch)
tree3255a9f3bbf167c1c0f8e245d2296479d2ceb579
parentd2bc6e278d5065cabf4b6ec42e6e23797d57cc04 (diff)
downloadvyos-live-build-c3968cf1c66a76872c528bf00e8a8556d06592c7.tar.gz
vyos-live-build-c3968cf1c66a76872c528bf00e8a8556d06592c7.zip
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.
-rwxr-xr-xshare/hooks/normal/0140-remove-log-files.hook.chroot2
1 files changed, 1 insertions, 1 deletions
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