From: Glynn Clements <glynn@gclements.plus.com>
To: Md Shanto <shanto76@gmail.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Starting "Script" when user logs on.
Date: Thu, 4 Aug 2005 12:11:56 +0100 [thread overview]
Message-ID: <17137.63484.676896.844904@cerise.gclements.plus.com> (raw)
In-Reply-To: <b30595cd050803033826add037@mail.gmail.com>
Md Shanto wrote:
> Initially I tired with "ttyrec" a tty recorder and failed, as it says
> "Out of pty's - Terminated".
Unless these processes aren't being cleaned up (in which case, you
will probably have over a hundred stale ttyrec processes), it may be
that ttyrec was compiled for BSD-style ptys but your system is using
Unix98 ptys (or vice-versa).
> 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
> ------------------
Apart from anything else, you should probably use "exec" for the last
statement, i.e.:
exec /usr/bin/script -q /var/log/commlog/$USER-$LOGTIME
This causes the "script" process to replace the bash process running
the shell script, rather than leaving the bash process hanging around
until script exits.
prev parent reply other threads:[~2005-08-04 11:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-03 10:38 Starting "Script" when user logs on Md Shanto
2005-08-03 12:48 ` urgrue
2005-08-03 13:01 ` Andy Davidson
2005-08-03 17:20 ` Jason Clark
2005-08-04 19:06 ` GH Snijders
2005-08-04 11:11 ` Glynn Clements [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17137.63484.676896.844904@cerise.gclements.plus.com \
--to=glynn@gclements.plus.com \
--cc=linux-admin@vger.kernel.org \
--cc=shanto76@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).