Leser: 3
|< 1 2 >| | 13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ./tatdaemon.pl 7070
Global symbol "$ip" requires explicit package name at ./tatdaemon.pl line 81.
Global symbol "$ip" requires explicit package name at ./tatdaemon.pl line 82.
Global symbol "$hersockaddr" requires explicit package name at ./tatdaemon.pl line 96.
Global symbol "$port" requires explicit package name at ./tatdaemon.pl line 97.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 97.
Global symbol "$hersockaddr" requires explicit package name at ./tatdaemon.pl line 97.
Global symbol "$herhostname" requires explicit package name at ./tatdaemon.pl line 98.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 98.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 99.
Global symbol "$hersockaddr" requires explicit package name at ./tatdaemon.pl line 164.
Global symbol "$port" requires explicit package name at ./tatdaemon.pl line 165.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 165.
Global symbol "$hersockaddr" requires explicit package name at ./tatdaemon.pl line 165.
Global symbol "$herhostname" requires explicit package name at ./tatdaemon.pl line 166.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 166.
Global symbol "$iaddr" requires explicit package name at ./tatdaemon.pl line 167.
Global symbol "$wtsocketport" requires explicit package name at ./tatdaemon.pl line 259.
Global symbol "$wtsocketport" requires explicit package name at ./tatdaemon.pl line 260.
Global symbol "$wtsocketport" requires explicit package name at ./tatdaemon.pl line 261.
Global symbol "@enviVars" requires explicit package name at ./tatdaemon.pl line 313.
Global symbol "$envi" requires explicit package name at ./tatdaemon.pl line 316.
Global symbol "@enviVars" requires explicit package name at ./tatdaemon.pl line 316.
Global symbol "$envi" requires explicit package name at ./tatdaemon.pl line 317.
Global symbol "$msg" requires explicit package name at ./tatdaemon.pl line 352.
Global symbol "$msg" requires explicit package name at ./tatdaemon.pl line 353.
Global symbol "$msg" requires explicit package name at ./tatdaemon.pl line 354.
Execution of ./tatdaemon.pl aborted due to compilation errors.
1
2
3
4
5
6
my $logfile=$PWD.$Thismachineaddr.".log";
open(LOGF, ">$logfile");
...
open STDIN, '/dev/null' or die "ERROR: Can't read /dev/null: $!";
open STDOUT, '>>/dev/null' or die "ERROR: Can't write to /dev/null: $!";
open STDERR, '>>/dev/null' or die "ERROR: Can't write to /dev/null: $!";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
sysopen(STDOUT,$logfile,O_WRONLY | O_APPEND | O_CREAT) or die $!;
sysopen(STDERR,$global,O_WRONLY | O_APPEND | O_CREAT) or die $!;
# WARNINGS können auch in eine andere, separate Logdatei
# weggeschrieben werden... das bevorzuge ich zum Beispiel.
sysopen(WARN,"$warns",O_WRONLY | O_APPEND | O_CREAT) or die $!;
$SIG{_ _WARN_ _} = \&warnHandler;
$SIG{_ _DIE_ _} = \&dieHandler;
sub warnHandler {
print WARN getTime(1), @_;
}
sub dieHandler {
print STDOUT getTime(1), @_;
# hier gibt es zwei print's, weil bei mir eine Meldung in eine
# globale überwachte error-Datei geschrieben wird...
# die andere ist für das normale Logfile
print STDERR getTime(1), "$0 ", @_;
exit(9);
}
sub getTime {
my $format = shift;
my @time = (localtime)[reverse 0..5];
$time[0] += 1900;
$time[1]++;
if (!$format) {
foreach (@time) { $_ = "0$_" if $_ < 10; }
return \@time;
} elsif ($format == 1) {
return sprintf '%04d-%02d-%02d %02d:%02d:%02d ', @time[0..5];
} elsif ($format == 2) {
return sprintf '%04d-%02d-%02d', @time[0..2];
} elsif ($format == 3) {
return sprintf '%02d-%02d-%02d', @time[3..5];
} elsif ($format == 4) {
return sprintf '%04d-%02d-%02d-%02d:%02d', @time[0..4];
}
}
1
2
print getTime(1), "Ich befinde mich gerade hier und mach dies\n";
print getTime(1), "Nun befinde ich mir gerade dort und mache das!\n";
man 5 proc
my $out=`$cmd`;
waitpid($pid,0)
|< 1 2 >| | 13 Einträge, 2 Seiten |