RHEL5 - Modify /usr/bin/script to include flushtime attribute
I am wanting to use the /usr/bin/script binary to log my users' sessions. It is working well, however if a user disconnects their session without logging out properly, anything in the buffer that has not yet been written to file is lost.
I have been searching for different versions of this program, and it seems that on most BSD distros there is a "flushtime" attribute on the -t switch that allows you to set how often the buffer is written to file. I think this would be a good fix, but that option doesn't exist in the version on RHEL or Fedora. There is a -t flag, but all it does is add date/time stamps to the log file. There is also a -f flush switch on RHEL but I have been unsuccessful with it so far.
Does anyone have any suggestions on replacing the /usr/bin/script program with one from another distro? Or perhaps recompiling/reinstalling? I have tried just simply compiling one of the BSD versions of script.c on my box but I am not that familiar with C and it spits out a bunch of errors that I do not understand. Any help would be greatly appreciated. Thanks!!