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!! |
Instead of 'script' check out 'rootsh'?
|
Thanks! That may work. I am trying it now. It seems to log pretty close to real time, and it seems to close cleanly when I close a session without exiting properly. It's nice that it appends the word "closed" to the end of a log file when the session is exited properly, that way I can see who is doing that and who isn't. This was a great tip and I will let you know asap how it goes.
|
All times are GMT -5. The time now is 07:17 AM. |