Main page | Install | ttyreplay(1) | rpldev(4) | rpl(5) | ttyrpld(7) | rplctl(8) | rpld(8) | Netlogging | Support


Name > rplctl - infod client
 
Synopsis >

rplctl [-A tty] [-D tty] [-L [tty]] [-S tty] [-X tty] [-Z [tty]] [-f socket] [-t]

 
Description >

The rplctl utility is used to query and control rpld and infod. It will print info about the requested ttys, or all ttys currently monitored or optionized if no arguments are given.

rplctl will read the INFOD_PORT variable from rpld.conf by default, if not overriden by the -f option.

 
Options >
-A tty Activate logging for the given tty. It can be a filename (which must exist) or a device number using "=MAJOR,MINOR".
-D tty Deactivate logging for the given tty.
-L [tty] Explicitly request a listing of all ttys currently active or have option set. If a tty is given, only display info for that particular one.
-S tty Deactivate logging for the given tty until it is deinitialized.
-X tty Call log_close() for the given tty. rpld will close the logfile, and necessarily open up a new one whenever new activity is detected (and logging this terminal is not deactivated) on that terminal.
-Z [tty] Zero all packet and byte counters, both of rpld and every single tty. If a tty is given, only zeroes the stats of that tty.
-f socket Path to the infod socket to connect to. The default is /var/run/.rplinfo_socket or INFOD_PORT in the rpld.conf configuration file.
-t Generate output suitable for sscanf(), split() or anything that deals best with simple text strings. See below for details on the output format.
 
Example output >

A command like `rplctl` could output this:

A TTY          BYTES IN       OUT FILENAME
==========================================================================
  *                2159     81129 ttyrpld 2.00
  IOCD: 0/118/117/0  RW: 1851/1396  I: 0  B: 0
--------------------------------------------------------------------------
D tty7              937         0 root/20050328.224208.tty7
D pts-1               0       586 boinc/20050328.224219.pts-1
D pts-2               0      5812 root/20050328.224208.pts-2
D pts-3             358     22113 root/20050328.224208.pts-3
D pts-4             864     52618 root/20050328.224341.pts-4
--------------------------------------------------------------------------

The status field (A) can be one of A, D or S: Activated, Deactivated, Deactived for this Session.

 
sscanf() format >

On the other hand, `rplctl -t` could produce this:

ttyrpld 2.00
format 3
0 144 143 0 3347 2496 3756 122881 0 0
D 4 7 tty7 1507 0 /var/log/rpl/root/20050328.224208.tty7
D 136 1 pts-1 0 1241 /var/log/rpl/boinc/20050328.224219.pts-1
D 136 2 pts-2 0 7585 /var/log/rpl/root/20050328.224208.pts-2
D 136 3 pts-3 365 22798 /var/log/rpl/root/20050328.224208.pts-3
D 136 4 pts-4 1884 91257 /var/log/rpl/root/20050328.224341.pts-4

The first line of the "parseable" output (-t) is the program used. It can (and should) be ignored by programs querying infod. The second is the status line about rpld. The sscanf formula is "%lu %lu %lu %lu %llu %llu %lu %lu". The fields are (in this order):

  • EVT_INIT -- tty first opens
  • EVT_OPEN -- number of open() operation on any tty
  • EVT_CLOSE -- number of close() operations on any tty
  • EVT_DEINIT -- tty deallocation
  • EVT_READ -- packets read from rpldev
  • EVT_WRITE -- packets read from rpldev
  • EVT_READ -- payload bytecount
  • EVT_WRITE -- payload bytecount
  • EVT_IOCTL packets received
  • packets considered bad (i.e. bad magic) -- might be more than there are actually damaged, because the algorithm needs to find something that looks good.

All other lines are tty information lines, whose formula is "%c %ld %ld %s %llu %llu %s", and the fields are:

  • status -- 'A' for activated, 'D' is deactivated and 'S' means deactivated until session ends.
  • major number
  • minor number
  • mnemonic string for the major/minor number
  • EVT_READ payload bytecount
  • EVT_WRITE payload bytecount
  • full filename being written to (this is different from the human-readable output which only shows it in part)
 
See also > rpld(8)
 

by Jan Engelhardt