Operating System - HP-UX
1838682 Members
4129 Online
110128 Solutions
New Discussion

script command hung on exit

 
Marco Queirolo
Occasional Contributor

script command hung on exit

Hello,
I'm logging the user sesion with script command, put in /etc/profile, but when the user exit the session, the session is hung. The big problem is when this occurr in the console of the server. I'm using HPUX 10.20.

Best regards.
marco
7 REPLIES 7
Paula J Frazer-Campbell
Honored Contributor

Re: script command hung on exit

Marco

What is your command?

Paula
If you can spell SysAdmin then you is one - anon
Pete Randall
Outstanding Contributor

Re: script command hung on exit

Paula,

He's put the "script" command into the user's profile in order to log the entire session - see man script.

Pete

Pete
Jordan Bean
Honored Contributor

Re: script command hung on exit


How is `script` invoked in the profile? I would use 'exec script' at the very end.

Marco Queirolo
Occasional Contributor

Re: script command hung on exit

Right,

At the end of the /etc/profile, I put the command " exec script "

Regards.
marco
Jordan Bean
Honored Contributor

Re: script command hung on exit


Can you tell if the user has any jobs in the background? If these need to continue running, then they should be invoked in a manner that prevents their stdio from attaching to the terminal device. For example:

batch < scriptfile

batch <<.
commands &
.

at now < scriptfile

at now <<.
commands &
.

and a favorite on the forums:

nohup command /dev/null 2>&1 &

Paula J Frazer-Campbell
Honored Contributor

Re: script command hung on exit

Pete

Yes I got the Script bit but was wondering about the format.

By using ???exec script the initial shell is sacrificed and so when the user exits there is no shell to wrap up there session.


Try it without the exec.

Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: script command hung on exit

Pete

Yes I got the Script bit but was wondering about the format.

By using ???exec script " the initial shell is sacrificed and so when the user exits there is no shell to wrap up their session.


Try it without the exec.


Also:-

Try not to use the console for anything else but critical system administration tasks - it is your last line of defence.

e.g. locked console and telnet not working = reboot


HTH

Paula
If you can spell SysAdmin then you is one - anon