System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

SOLVED
Go to solution
sujit kumar singh
Honored Contributor

Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Hi

I am setting the TMOUT variable to 900 and making that readonly.

export TMOUT=900
readonly TMOUT

What shall happen to the make_tape_recovery command that invoked from the shell is going to take more time than this setting.that is is that period considered as inactivity of the console and shall that terminal close and the process of that command terminate?


i know that a command can be executed like


#nohup &
If i do not use nohup for the same.



Of Any Database process is initiated from a Terminal set with this TMOUT setting and that takes more time to execute then what shall happen to that terminal and the associated process?


Regards
sujit
5 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Hi Sujit:

If you are running a process in the shell's foreground, the process will complete in whatever time it needs before the idle timeout period begins.

If you run a process in the background you need to add the 'nohup' to immunize the process from a hang-up when the idle timeout of the shell is reached.

Database processes will probably daemonize themselves at startup and thus will have their parent process as 'init' (pid=1). In this case they are immune from any shell timeout once started.

You can verify these behaviors with simple 'sleep' commands in various scenarios.

Regards!

...JRF...
sujit kumar singh
Honored Contributor

Re: Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Hi JRF,

sorry for not able to comprehend your post properly.

>> If you are running a process in the shell's foreground, the process will complete in whatever time it needs before the idle timeout period begins.

that is if make_tape_recovery say takes 45 mins and i execute that from a shell where TMOUT is 900 then shall the TMOUT count begin if i leave the terminal unattended and make_tape_recovery completes.or is that TMOUT count starts from the time the command is executed and the terminal left untouched.

Suppose a Query for a report is made using a command and that takes 1 hour to complete, is in that case also when the command is executed and the terminal is left unattended is the TMOUT count going to happen after the query invoked by the command is complete?or is that TMOUT count starts from the time the command is executed and the terminal left untouched.

regards
sujit
James R. Ferguson
Acclaimed Contributor
Solution

Re: Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Hi (again):

> that is if make_tape_recovery say takes 45 mins and i execute that from a shell where TMOUT is 900 then shall the TMOUT count begin if i leave the terminal unattended and make_tape_recovery completes.or is that TMOUT count starts from the time the command is executed and the terminal left untouched.

The timeout countdown begins when the command finishes executing.

> Suppose a Query for a report is made using a command and that takes 1 hour to complete, is in that case also when the command is executed and the terminal is left unattended is the TMOUT count going to happen after the query invoked by the command is complete?or is that TMOUT count starts from the time the command is executed and the terminal left untouched.

If the query (command) is running as a process of the shell, then the countdown begins when the command finishes, otherwise the countdown begins immediately after the command is entered.

Constructing test scenarios with a simple 'sleep' is useful to an understanding.

Regards!

...JRF...
sujit kumar singh
Honored Contributor

Re: Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Thanks JRF for the explanation.

sujit kumar singh
Honored Contributor

Re: Guide on TMOUT settings// what shall happen to a command executed that shall be taking more time to

Thanks again!
Closing the thread.
regards
sujit