TTY replay daemon

   
Setting up rpld >

Even though rpld is small, it yet has a number of options to individually change its behavior. Most configuration file variables also have a command-line option counterpart. See the rpld.conf file for details. `rpld -?` will give you a brief overview of CL options available.

The default configuration file rpld.conf in the directory where rpld was started is examined first, you can add additional config files with the -c option.

 
Logging >

rpld does not detach itself to help debugging, but using the startproc or setsid starter tool can help bringing it in the background, if you need to. The only time when the daemon will output something is either during initialization (startproc will catch if rpld exits early) or when there is really trouble, like memory allocation failure. In either case, error messages are rare and you would not need to worry about redirecting stderr.

You can run rpld with the -v option to enable printing statistics on stdout. Even if you do not have -v specified, you can send rpld a SIGALRM signal to make it print the current statistics. That of course only makes sense when stdout is connected to something but /dev/null. You can send it multiple SIGALRMs, of course, but you should consider using -v then, maybe.

In verbose mode (-v) the statistics are printed with the move-to-beginning-of-line character (\r), which is not that suitable for logging, though.

Logfiles are created using the OFMT variable from the configuration file (can be overridden with the -O option), which also carries the logging directory. The default in the original ttyrpld package is OFMT=log/%u@%d.%l, and log is a symlink to /var/log/rpl. Please create that directory if you attempt to use it, otherwise change OFMT and/or the symlink. Also note that the logging directory must be writable for the user running rpld, which is not root but the user you chose in the config file (or -U option).

Basically, every tty is monitored, but certain kinds are excluded, like the master side of BSD (major number 2) and Unix98 ptys (major number 128 to 135), because they are just a mirror of their slave sides with things turned around.

Each packet recorded is also added a timestamp, but ttyreplay is not yet that advanced to display it. Hopefully, the user has a clock set up in his shell prompt.

 
Examining the logs >

ttyreplay is the tool to see -- to replay -- what has been captured by (the Kernel module and) rpld. Give it any number of files you want to see again.

There is an example file I provided, you can watch it with bzip2 -cd Commenting_ovcorr.bz2 | ttyreplay /dev/stdin. It shows 1:1 (and in full color!) how I commented the nsleep_ovcorr() function. It is advisable to run it with speed factor 3.0 (-S option), because in real-time, it takes approx. 35 minutes.