/[Sack]/trunk/lib/Sack/Pid.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Sack/Pid.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 132 - (show annotations)
Wed Oct 7 17:27:43 2009 UTC (14 years, 8 months ago) by dpavlin
File size: 363 byte(s)
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