memtee is a replacement for 'tee' in situations were no read-write mounted filesystem is available.
In such a case memtee buffers all output into memory and when it receives the TERM-signal, it writes that buffered data into a file.
This way one can have for example the output of fsck in the startup-scripts buffered and when a filesystem
is mounted rw, one can signal memtee the flush that fsck-output onto disk by sending it a TERM signal.
/sbin/fsck -A -a 2>&1 | /usr/bin/memtee -o /var/log/fsck-boot.log -m 0
Here the output of 'fsck' is buffered. After 'fsck' terminates, memtee forks itself into the background.
When the filesystems are available for rw access, this command will make memtee write the output of fsck