Starting "Script" when user logs on.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am trying to force "script" for logging all text I/O activities at
the moment user logs in. Most of the users are running bash at this
moment.

Initially I tired with "ttyrec" a tty recorder and failed, as it says
"Out of pty's - Terminated". Now, I tried something like below:

------------------
#!/bin/bash -l
USER=`whoami`
LOGTIME=`date +%Y-%m-%d-%H:%M:%S`
/usr/bin/script -q /var/log/commlog/$USER-$LOGTIME
------------------

and assigning this script in /etc/passws. This script will log scripts
with time stamp in /var/log/commlog/.

what happen is: when user logs in the process becomes a loop and I see
lot of script instances are running.

Any idea.

-Refayet
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux