Leser: 2
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
5
Can't locate loadable object for module Win32::Daemon in @INC (@INC contains: CO
DE(0xd4b068) CODE(0xe39f98) .) at ../blib/lib/PAR/Heavy.pm line 101
Compilation failed in require at script/Server_servicepart_ver2.40.pl line 6.
BEGIN failed--compilation aborted at script/Server_servicepart_ver2.40.pl line 6
.
perl ppm.pl install http://www.roth.net/perl/packages/win32-daemon.ppd
Quoteppm> unins Win32-Daemon
====================
Remove 'Win32-Daemon' version 0.2003.06.17 from ActivePerl 5.8.6.811.
====================
unlink C:\Perl\site\lib\Win32\DAEMON.PM
unlink C:\Perl\site\lib\Win32\daemon\AutoStart.pl
unlink C:\Perl\site\lib\Win32\daemon\Callback.pl
unlink C:\Perl\site\lib\Win32\daemon\Callback2.pl
unlink C:\Perl\site\lib\Win32\daemon\Create.pl
unlink C:\Perl\site\lib\Win32\daemon\Daemon_Template.pl
unlink C:\Perl\site\lib\Win32\daemon\Remove.pl
unlink C:\Perl\site\lib\Win32\daemon\Security.pl
unlink C:\Perl\site\lib\Win32\daemon\Win32-daemon.ppd
unlink C:\Perl\site\lib\Win32\daemon\autostart.ini
unlink C:\Perl\site\lib\Win32\daemon\daemon.htm
unlink C:\Perl\site\lib\Win32\daemon\daemon.pl
unlink C:\Perl\site\lib\auto\Win32\daemon\daemon.DLL
unlink C:\Perl\site\lib\auto\Win32\Daemon\.packlist
Successfully removed Win32-Daemon version 0.2003.06.17 from ActivePerl 5.8.6.811
.
ppm> install 1
Package 1:
====================
Install 'http://www.roth.net/perl/packages/Win32-Daemon.ppd' version 0.2003.06.17 in ActivePerl 5.8.6.811.
====================
Downloaded 59860 bytes.
Extracting 13/13: blib/lib/Win32/DAEMON.PM
Installing C:\Perl\site\lib\auto\Win32\daemon\daemon.DLL
Files found in blib\arch: installing files in blib\lib into architecture depende
nt library tree
Installing C:\Perl\site\lib\Win32\DAEMON.PM
Installing C:\Perl\site\lib\Win32\daemon\autostart.ini
Installing C:\Perl\site\lib\Win32\daemon\AutoStart.pl
Installing C:\Perl\site\lib\Win32\daemon\Callback.pl
Installing C:\Perl\site\lib\Win32\daemon\Callback2.pl
Installing C:\Perl\site\lib\Win32\daemon\Create.pl
Installing C:\Perl\site\lib\Win32\daemon\daemon.htm
Installing C:\Perl\site\lib\Win32\daemon\daemon.pl
Installing C:\Perl\site\lib\Win32\daemon\Daemon_Template.pl
Installing C:\Perl\site\lib\Win32\daemon\Remove.pl
Installing C:\Perl\site\lib\Win32\daemon\Security.pl
Installing C:\Perl\site\lib\Win32\daemon\Win32-daemon.ppd
Successfully installed Win32-Daemon version 0.2003.06.17 in ActivePerl 5.8.6.811
.
ppm>
pp -l C:\Perl\site\lib\auto\Win32\daemon\daemon.DLL -M Win32::Daemon vE:\Daten\Arbeit\Perl-Scripte\Go_Back!up\RC_2.0\Server_servicepart_ver2.40.pl
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#! perl
use File::Spec;
use IO::Socket;
use IO::Select;
use Win32::API;
use Win32;
use Win32::Daemon;
use Par::Heavy;
use strict;
use warnings;
#use POSIX qw(:signal_h);
my $programmpfad = $0;
$programmpfad =~ s/[^\\]*?$//;
use Win32::Daemon::Simple
Service => 'Go Back!Up',
Name => 'Go Back!Up Service',
Version => 'RC2.0',
Info => {
display => 'Go Back!Up Service RC2.0',
description => 'Backup Programm',
interactive => '1',
},
Params => {
Tick => 0,
Talkative => 0,
Interval => 1,
LogFile => "GoBackUp.log",
Description => <<'*END*',
Tick : (0/1) controls whether the service writes a "tick" message to
the log once a minute if there's nothing to do
Talkative : controls the amount of logging information
Interval : how often does the service look for new or modified files
(in minutes)
LogFile : the path to the log file
...
*END*
},
param_modify => {
#LogFile => sub {File::Spec->rel2abs($_[0])},
#tAlkative => sub {undef}
};
ServiceLoop(\&doSomething);
exit;
sub doSomething
{
$SIG{'CHLD'} = 'IGNORE';
my $pid = fork();
if($pid == 0)
{
my $server = IO::Socket::INET->new(
LocalPort => 2005,
type => SOCK_STREAM,
Reuse => 1,
Listen => 10
) or die "Server läuft nicht: $@\n";
my $select = IO::Select->new($server);
while(my @readable = $select->can_read)
{
foreach my $socket (@readable)
{
if($socket == $server)
{
my $client = $socket->accept;
print "New client connects\n";
$select->add($client);
#$client->print("process still running\n");
}
else
{
my $computername = $socket->getline;
$computername =~ s!\r?\n$!!g; # Zeilenumbruch entfernen
if (defined $computername)
{
chomp $computername;
my $WindowAvailable ="";
$WindowAvailable = FindWindow("$computername");
print "$WindowAvailable\n";
if ($WindowAvailable == 0)
{
#$client->print ("Window ist nicht vorhanden\n");
system "start \"$computername\" \"E:\\Daten\\Arbeit\\Perl-Scripte\\Go_Back!up\\RC_2.0\\Server_ver2.01.pl\"";
#$socket->print("reconnect\n");
$socket->print("port=12346\n");
delete_socket($select, $socket);
}
else
{
$socket->print("process still running\n");
}
}
else
{
print "Client says: [$computername]\n";
delete_socket($select, $socket);
}
}
}
sub FindWindow
{
my $WindowName = shift(@_);
chomp $WindowName;
print "$WindowName";
my $FindWindow = new Win32::API('user32', 'FindWindow', ['P','P'], 'N');# or die print "$!";
my $name = 'Telnet 127.0.0.1';
my $class = 0;
my $topHwnd = $FindWindow->Call($class, $WindowName);
print "$topHwnd\n";
return $topHwnd;
}
sub delete_socket
{
my ($sel, $sock) = @_;
$sel->remove($sock);
$sock->close;
}
}
}
else
{
if (Win32::Daemon::State() == SERVICE_STOP_PENDING)
{
kill 'SIGKILL', $pid;
Win32::Daemon::State(SERVICE_STOPPED);
Win32::Daemon::StopService();
exit 0;
}
}
}
pp -l C:\Perl\site\lib\auto\Win32\daemon\daemon.DLL -M Win32::Daemon -M Win32:Daemon::Simple E:\Daten\Arbeit\Perl-Scripte\Go_Back!up\RC_2.0\Server_servicepart_ver2.40.pl
|< 1 2 >| | 11 Einträge, 2 Seiten |