Truncate instead of deleting log files

For package installs we need to be able to fix up permissions in
/var/log at install time, and if we delete all of the files then
those permission fixes get lost.  To deal with that, we can just
empty the files instead of deleting them.

Change-Id: I70abb354e4dc726ec7a176694c7c6e9455d89d08
This commit is contained in:
Ben Nemec 2014-08-26 22:40:45 -05:00
parent c445a6c66a
commit 417b511147

View File

@ -20,7 +20,7 @@ set -eux
set -o pipefail
# Truncate /var/log files in preparation for first boot
sudo find $TARGET_ROOT/var/log -type f -delete
sudo find $TARGET_ROOT/var/log -type f -exec cp /dev/null '{}' \;
# also /root logs
sudo find $TARGET_ROOT/root -name \*.log -type f -delete