Parent Directory
|
Revision Log
fix kill message
1 | package Sack::Pid; |
2 | |
3 | use warnings; |
4 | use strict; |
5 | |
6 | use File::Slurp; |
7 | |
8 | sub port_pid { |
9 | my ( $self, $port, $pid ) = @_; |
10 | |
11 | $pid ||= $$; |
12 | |
13 | my $pid_path = "/tmp/sack.$port.pid"; |
14 | if ( -e $pid_path ) { |
15 | my $old_pid = read_file $pid_path; |
16 | warn "[$port] kill old $old_pid from $pid\n"; |
17 | kill 9, $old_pid; |
18 | } |
19 | write_file $pid_path, $pid; |
20 | warn "[$port] pid $pid\n"; |
21 | |
22 | } |
23 | |
24 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |