| 33 |
|
$filter_addr |
| 34 |
|
$file_list |
| 35 |
|
$fqdn |
| 36 |
+ |
$pidfile |
| 37 |
|
); |
| 38 |
|
|
| 39 |
|
if (@ARGV != 2) { |
| 45 |
|
|
| 46 |
|
$seq_no = 1; |
| 47 |
|
|
| 48 |
+ |
# write our PID to a file |
| 49 |
+ |
$pidfile = "/var/tmp/ihost.pid"; |
| 50 |
+ |
&write_pid(); |
| 51 |
+ |
|
| 52 |
|
&tcp_configure(); |
| 53 |
|
&send_udp_packet(); |
| 54 |
|
|
| 76 |
|
`sleep $delay`; |
| 77 |
|
} |
| 78 |
|
|
| 79 |
+ |
# we'll probably never get here... |
| 80 |
+ |
`rm -f $pidfile`; |
| 81 |
|
exit(0); |
| 82 |
|
|
| 83 |
|
|
| 374 |
|
|
| 375 |
|
close($sock); |
| 376 |
|
print "^"; |
| 377 |
+ |
|
| 378 |
+ |
return; |
| 379 |
+ |
} |
| 380 |
+ |
|
| 381 |
+ |
#----------------------------------------------------------------------- |
| 382 |
+ |
# write_pid |
| 383 |
+ |
# Writes the PID (process ID) of this instance to $pidfile. |
| 384 |
+ |
# This is then used by a seperate script to check (and restart) ihost. |
| 385 |
+ |
#----------------------------------------------------------------------- |
| 386 |
+ |
sub write_pid() { |
| 387 |
+ |
open PID, ">$pidfile"; |
| 388 |
+ |
print PID $$; |
| 389 |
+ |
close PID; |
| 390 |
|
|
| 391 |
|
return; |
| 392 |
|
} |