Closed chorrell closed 8 years ago
We actually don't want to delete this as it doesn't necessarily get recreated. It can lead to warnings like
Oct 7 19:54:07 bd642506-bacb-4f73-8692-dd1f1dc548e2 sshd[1376]: lastlog_openseek: Couldn't stat /var/log/lastlog: No such file or directory
I think what would be better is to have the cleanup_logs function cat /dev/null > the log files rather than delete them.
cat /dev/null >
So instead of this:
find /var/log -type f | xargs rm -f
We do this:
find /var/log -type f -exec sh -c '>{}' \;
So that just empties the files and then we also don't need to do things like recreated /var/log/wtmp here:
https://github.com/joyent/sdc-imgapi/blob/master/tools/prepare-image/linux-prepare-image#L67
We actually don't want to delete this as it doesn't necessarily get recreated. It can lead to warnings like
I think what would be better is to have the cleanup_logs function
cat /dev/null >
the log files rather than delete them.So instead of this:
We do this:
So that just empties the files and then we also don't need to do things like recreated /var/log/wtmp here:
https://github.com/joyent/sdc-imgapi/blob/master/tools/prepare-image/linux-prepare-image#L67