You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lnav/src/tailer
Timothy Stack d0ba84d9be [build] run cmake-init and switch from hunter to conan for packages 2 years ago
..
CMakeLists.txt [build] run cmake-init and switch from hunter to conan for packages 2 years ago
Makefile.am [distclean] more files to remove 3 years ago
README.md [remote] add some docs and allow ssh command customization 3 years ago
drive_tailer.cc [tailer] send the uname of the remote host back 3 years ago
sha-256.c [build] fix ape build 3 years ago
sha-256.h [remote] optimize file syncing 3 years ago
tailer.ape Update tailer 3 years ago
tailer.c [build] missing include 3 years ago
tailer.h [tailer] send the uname of the remote host back 3 years ago
tailer.looper.cc [pcap] initial pcap support 3 years ago
tailer.looper.cfg.hh [remote] clean up the cache 3 years ago
tailer.looper.hh [remote] clean up the cache 3 years ago
tailer.main.c [remote] fix issue with symlinked files 3 years ago
tailerpp.cc [tailer] set the mtime on the synced file 3 years ago
tailerpp.hh [remote] optimize file syncing 3 years ago
test_tailer.sh [build] try to fix tailer test 3 years ago

README.md

Tailer

This directory contains the functionality for monitoring remote files. The name "tailer" refers to the binary that is transferred to the remote host that takes care of tailing files and sending the contents back to the host that is running the main lnav binary. To ease integration with lnav's existing functionality, the remote files are mirrored locally. The tailer also supports interactive use by providing previews of file contents and TAB-completion possibilities.

Files

The important files in this directory are:

  • tailer.main.c - The main() implementation for the tailer.
  • tailer.looper.hh - The service in the main lnav binary that transfers tailers to hosts and communicates with them.
  • tailer.h and tailerpp.hh - Utility libraries for the tailer protocol.
  • tailer.ape - The αcτµαlly pδrταblε εxεcµταblε build of the tailer. This binary is produced by a GitHub Action and checked in so the build process doesn't need to be supported on lots of platforms.

Flow

When a remote-path is passed to lnav, the file_collection.hh logic forwards the request to the tailer::looper service. This service makes two connections to the remote host using the ssh command so that the user's custom configurations will be used. The first connection is used to transfer the "tailer.ape" binary and make it executable. The second connection starts the tailer and uses stdin/stdout for a binary protocol and stderr for logging. The tailer then waits for requests to open files, preview files, and get possible paths for TAB-completions.