Skip to contentSkip to conversation

Starting "Script" when user logs on.

DISCUSSION Md Shanto 1 participant 1 message Aug 3, 2005

lore
Share & tools
lore

Md Shanto

author
#0 lore raw

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
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs