Background & is considered as Idle

Our Aix Unix has one issue.

If I type xedit &
after 30 minutes, xedit auto shut down.

If I type xedit
xedit will run forward.

I feel this & doesn't perform as it should be.

When I use &, system consider this process as idle.

How to fix this issue?
Does this mean unix env variables not set up right?

Thank you.

David.

what do you mean it will shutdown?

When I type xedit, a window pop up for me to type in any text. After 30 minutes, this window close by itself.

Thank you.

Well, your terminal certainly is idle -- sitting waiting at a prompt while you do nothing with it.

Surely there's a way to prevent your background tasks being killed by the idle timer though. They're not killed because they're idle, but because they have open handles to the terminal... something xedit doesn't even need. Try nohup xedit & which should close all references it has to the terminal and prevent it being killed when it closes. Depending on your shell you might do "& disown" instead of just &.

I am using AIX Korn Shell.
Your suggestion is
nohup xedit &

or

xedit & disown

Is this right?

Thank you.

Hi.

disown is a ksh93 built-in. At least up to AIX 5.3 TL12 there is no ksh93 that has disown (citation needed, as Wikipedia would say! At least not on any of my TL12 servers).

Did you try the nohup option?

Neither. nohup xedit & disown

I try this
xedit &
then process number shows on terminal. I can type any command through terminal. Process will die in 30 minutes.

I try this
xedit &
since this is foreground process so I can't use this terminal to do anything.
This terminal never die or close.

When I try
nohup xedit &

this is very similiar to xedit. I can't use this terminal.

My question?

nohup xedit & == xedit

at least from what I see on screen, they are very similar.

I feel & is not set up right, but I don't know what cuases this issue?

Thank you.

That's not how it works. & is not a thing to "set up". As explained before, things get killed when your terminal closes when they still have references to the terminal.

yes, because your terminal's been idle for 30 minutes and closes. Or does it not close your terminal too?

Was that a typo? 'xedit &' is not a foreground process.

Are you sure you typed 'nohup xedit &' and not just 'nohup xedit'? And you didn't use the disown command we suggested either.

& means 'put this in the background'.

If nohup doesn't want to work, try this:

xedit < /dev/null > /dev/null 2> /dev/null & disown

That's more or less what I was trying to do with nohup, but done the hard way. This should run in background and not close when the terminal does.

Can you explain again what does this mean "open handles to the terminal"?

We have several aix unix servers.

Why xedit &
works ok in other unix server and never die (close)?

Thank you.

When you run an application from a terminal, it gets copies of whatever files it has open. In this case, stdin, which reads from your terminal window; stdout, which writes to your terminal window; and stderr, which also writes to your terminal window. When the terminal closes, anything that still has these open dies.

By closing these, since xedit doesn't need them anyway, you prevent it from being killed.

Probably because those terminals aren't set to time out.

If turning off your terminal's timeout is what you want to do now, you might be able to by running TMOUT=0, if your administrator hasn't disabled this.

try this

echo $TMOUT
unset TMOUT

This is what came to my mind first too. If a variable "TMOUT" is set to some integer value the system will log off idle sessions automatically after this many seconds of inactivity. If the terminal closes all the processes started via this terminal are being closed too and probably this is what has happened with xedit.

You might want to include these lines in your "~/.kshrc" file.

I hoep this helps.

bakunin