3 de enero de 2010

Como terminar un proceso con Perl

Pues con kill.
kill ( 'SIGNAL' , PID );

Lista de señales:

Signal
Number
Description
SIGHUP
1
On hangup
SIGINT
2
On interrupt
SIGQUIT
3
On Quit key
SIGILL
4
Illegal instruction
SIGTRAP
5
Trap instruction
SIGABRT
6
Abort message
SIGIOT
6
Input/output transfer
SIGBUS
7
Bus error
SIGFPE
8
Floating-point error
SIGKILL
9
Kill signal from system
SIGUSR1
10
User defined
SIGSEGV
11
Segmentation violation
SIGUSR2
12
User defined
SIGPIPE
13
Pipe fault (broken pipe)
SIGALRM
14
Alarm
SIGTERM
15
Termination
SIGSTKFLT
16
Stack fault
SIGchLD
17
Signal from child
SIGCONT
18
Continuing a stopped process
SIGSTOP
19
Stopping a process
SIGTSTP
20
Stopping a process from terminal
SIGTTIN
21
Stopping a process reading from controlling terminal
SIGTTOU
22
Stopping a process writing to controlling terminal
SIGURG
23
Urgent condition
SIGXCPU
24
Excessive CPU limits reached
SIGXFSZ
25
Excessive file size limits reached
SIGVTALRM
26
Virtual interval timer expired
SIGPROF
27
Profiling interval timer expired
SIGWINch
28
Window size changed by background process
SIGIO
29
Asynchronous I/O
SIGPWR
30
Power failure
SIGUNUSED
31
Unused

ejemplo:
kill ('KILL' , $PID);

REF:
http://ods.com.ua/win/eng/program/Perl5Unleashed/ch14.phtml#Signals

No hay comentarios:

Publicar un comentario