There are situations where the list of users currently logged on may become incorrect and require manual cleaning of old data.

Summary

The list of users currently logged in to BoKS on any server across a domain is kept in the database (table 5) and can be viewed from the FoxT Command Console under the "Domain" section. There are situations where this list may contain old entries that are never automatically removed. This can happen, for instance, if a database backup of table 5 is restored.


Procedure


FoxT provides a custom perl script, cleanlogout.pl (see link at bottom of article) for synchronization of login information in the BoKS database from $BOKS_var/btmp locally on each BoKS Server Agent. With the assumption that the information in btmp is correct, entries are removed from the database table TAB_LOGIN(5) if the corresponding entry doesn't exist in the file btmp locally on the BoKS Server Agent.

The script can be run manually on demand but is preferably run from boksinit.master or BoKS cron ($BOKS_etc/bokscron.conf) once an hour or once a day. (If run from OS cron there is a risk that BoKS is down when the script is executed).


The script reads the contents of TAB_LOGIN and retrieves the corresponding btmp/bwho information from the BoKS Server Agent to compare with. Entries that exist in TAB_LOGIN but not in btmp are deleted.


If btmp cannot be retrieved the entry is preserved.
Any entries in table 5 defined for unregistered hosts are deleted unconditionally.

Usage: cleanlogout.pl [-h host [-h host ...]][-x level]
Options:
-h host Limit the clean-up to entries in table 5 for one or more hosts. Multiple -h options are allowed.
-x debuglevel Be somewhat verbose about the progress.

Caveat: In the case where the $BOKS_var/btmp file is empty, no entries will be cleaned for the particular host, since cleanlogout.pl is
unable to distinguish this state from an error condition.

Link to the cleanlogout.pl script


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: May 25, 2018