|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : yurik shestakov 2:5020/400 26 Nov 2004 13:20:28 To : Mikhail Polykovsky Subject : Re: отследить смерть скрипта -------------------------------------------------------------------------------- On Fri, Nov 26, 2004 at 09:13:48AM +0000, Mikhail Polykovsky wrote: ys>> Может. Hапример стоит лимит по памяти, времени исполнения или ys>> размеру записываемого файла. ys>> В случае превышения лимита ядро операционки просто прибивает процесс ys>> и пишет (обычно) в syslog. MP> И такую смерть внутри скрипта никак не отловить? man setrlimit. В общем случае в процесс посылается сигнал. По-дефолту процесс останавливается. Hо сигнал можно перехватить. ======================================================================== RLIMIT_CPU CPU time limit in seconds. When the process reaches the soft limit, it is sent a SIGXCPU signal. The default action for this signal is to terminate the process. However, the signal can be caught, and the handler can return control to the main program. If the process continues to consume CPU time, it will be sent SIGXCPU once per second until the hard limit is reached, at which time it is sent SIGKILL. (This latter point describes Linux 2.2 and 2.4 behaviour. Implementations vary in how they treat processes which continue to consume CPU time after reach- ing the soft limit. Portable applications that need to catch this signal should perform an orderly termination upon first receipt of SIGXCPU.) RLIMIT_DATA The maximum size of the process's data segment (initialized data, uninitialized data, and heap). This limit affects calls to brk() and sbrk(), which fail with the error ENOMEM upon encountering the soft limit of this resource. RLIMIT_FSIZE The maximum size of files that the process may create. Attempts to extend a file beyond this limit result in delivery of a SIGXFSZ signal. By default, this signal terminates a process, but a process can catch this signal instead, in which case the relevant system call (e.g., write(), truncate()) fails with the error EFBIG. [...] RLIMIT_STACK The maximum size of the process stack, in bytes. Upon reaching this limit, a SIGSEGV signal is generated. To handle this sig- nal, a process must employ an alternate signal stack (sigalt- stack(2)). ======================================================================== -- // yurik shestakov --- ifmail v.2.15dev5.3 * Origin: Unknown (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/10069c6a8cf1c.html, оценка из 5, голосов 10
|