Определите “действие строки”, как понято под Unix, кто управляет

tmpwatcher или "tmpreaper" в человечности.

http://linux.about.com/library/cmd/blcmdl8_tmpwatch.htm

используйте с-c

3
задан 4 June 2012 в 17:32
2 ответа
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
jferland pts/2    jferland:S.1     10:35    2.00s  0.18s  0.18s /bin/bash
jferland pts/3    jferland:S.2     10:35   45.00s  0.18s  0.00s sleep 30
jferland pts/1    jferland:S.0     10:35    0.00s  0.21s  0.00s w

S.0: The one I'm checking on, so definitely 0 time there.

S.1: I left a shell open. Two seconds before I pressed a key without pressing enter. So, any input received works even without a line return.

S.2: I ran while true; do echo "foo"; sleep 30; done. I even typed a character in the middle of it. Since the input was blocked (never read), I still appear idle there.

Conclusion

Idle time is reset when a character is read from the terminal input. Blocked input doesn't update idle time even if it does affect the screen display. Applications may update under different rules. For example, I used write which reads input by line, so it only updated my idle time upon pressing enter. The same was true for perl (literally executed as perl with no arguments).

4
ответ дан 3 December 2019 в 05:46

Processes run all the time, and it doesnt matter for idle time.

If you do a:

while true; do w; sleep 0.1; done

in one terminal, and open another terminal, you will see that idle time of that other session is reset to zero, only when user inputs something (presses a key). If you run:

while true; do ls; done

in the other terminal the idle time will continue to rise.

So only when the session reads user input, the idle timer is reset.

1
ответ дан 3 December 2019 в 05:46

Теги

Похожие вопросы