Schrift
[thread]5436[/thread]

SSH fehler bei einem bestimmten Aufruf



<< >> 4 Einträge, 1 Seite
schnapsfahne
 2004-09-02 15:01
#48966 #48966
User since
2004-09-02
2 Artikel
BenutzerIn
[default_avatar]
Hallo,

habe in Perl/CGI ein Monitoringtool mitentwickelt und nun stehen wir vor einem Problem, was nicht so auf die schnelle behebar ist.

Es läuft wie folgt ab.
Das Hauptprogramm läuft dauerhaft und startet einzelne Prozessdateien zur Überprüfung.
Die Ergebnisse werden über apache den Anwendern präsentiert.
Ebenso können Anwender mit Administrationsrechten das Hauptprogramm beenden oder starten.
Und genau hier liegt das Problem. Starten und beenden kann er das Hauptprogramm, aber es läuft fehlerhaft.

Der user ist wwwrun der die Prozesse startet. Wenn ich mich über Konsole als wwwrun einloge und den Befehl über konsole eingebe, der über den browser sonst ausgeführt wird, klappt alles einwandfrei.

Hier die folgenden Fehler:
Quote
mkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
ping ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
datei ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
login ende
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 69.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 70.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 71.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 72.
ping ende
mkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
datei ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
login ende


Im ganzen Quelltext kommt aber kein mkdir vor.
Code: (dl )
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
$cmd= "ls -l";
#$cmd= "id";
$ssh = Net::SSH::Perl->new($server, protocol=>2);
$ssh->login( $user, $passwort );
try {
#print "Vor cmd\n";
($v_stdout, $v_stderr, $v_exit) = $ssh->cmd($cmd);
#print "Nach cmd\n";
if ($target eq 'quelle' ) {
$writedb = `./writedb2.pl 10 \"login_quelle\" 0 \"$intf_name\" \"login.pl\" \"$mail\"`;
$writedb = `./writedb2.pl 0 4 \"login.pl\" \"$server\"`; # Alles OK
} else {
$writedb = `./writedb2.pl 10 \"login_ziel\" 0 \"$intf_name\" \"login.pl\" \"$mail\"`;
$writedb = `./writedb2.pl 0 4 \"login.pl\" \"$server\"`;
}

} except {
$writedb = `./writedb2.pl 0 3 \"login.pl\" \"$server\"`; # Fehler schreiben
if ("$target" eq "quelle" ) {
$writedb = `./writedb2.pl 10 \"login_quelle\" 1 \"$intf_name\" \"login.pl\" \"$mail\"`;
} else {
$writedb = `./writedb2.pl 10 \"login_ziel\" 1 \"$intf_name\" \"login.pl\" \"$mail\"`;
}
}
finally {
$writedb = `./writedb2.pl 0 2 \"login.pl\" \"$intf_name\"`; # Ende schreiben
}


Hab mir dann mal die Module vorgenommen.
Quote
make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/0-signature....gpg: Signature made Wed Oct 8 16:29:54 2003 CEST using DSA key ID 06D8C374
gpg: requesting key 06D8C374 from x-hkp://pgp.mit.edu:11371 ...
gpg: can't get key from keyserver: Connection refused
gpg: Can't check signature: public key not found
Not in MANIFEST: blibdirs
==> MISMATCHED content between MANIFEST and distribution files! <==
# Failed test (t/0-signature.t at line 18)
# Looks like you failed 1 tests of 1.
t/0-signature....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
t/00prim.........ok
t/01tag..........ok
t/02seq..........FAILED tests 17-18
Failed 2/18 tests, 88.89% okay
t/03seqof........ok
t/04opt..........ok
t/05time.........ok
t/06bigint.......ok
t/07io...........ok
t/08set..........ok
t/09contr........ok
t/10choice.......ok
t/11indef........ok
t/12der..........ok
t/13utf8.........ok
t/14any..........ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/0-signature.t 1 256 1 1 100.00% 1
t/02seq.t 18 2 11.11% 17-18
Failed 2/16 test scripts, 87.50% okay. 3/420 subtests failed, 99.29% okay.
make: *** [test_dynamic] Error 29

Überinstallieren klappt leider nicht wie man gesehen hat. Der bricht vorher schon ab. Empfehlungen?
Thorium
 2004-09-02 15:22
#48967 #48967
User since
2003-08-04
232 Artikel
BenutzerIn
[Homepage] [default_avatar]
Der ssh-client erstellt ein .ssh verzeichnis (im Home?) - desshalb der mkdir. Das ist alles was mir dazu einfällt :D


EDIT:
Quote
Net::SSH::Perl->new($host, %params)

To set up a new connection, call the new method, which connects to $host and returns a Net::SSH::Perl object.

new accepts the following named parameters in %params:

  • identity_files

A list of RSA/DSA identity files to be used in RSA/DSA authentication. The value of this argument should be a reference to an array of strings, each string identifying the location of an identity file. Each identity file will be tested against the server until the client finds one that authenticates successfully.

If you don't provide this, RSA authentication defaults to using $ENV{HOME}/.ssh/identity, and DSA authentication defaults to $ENV{HOME}/.ssh/id_dsa.


Vielleicht willst du also die option setzen?\n\n

<!--EDIT|Thorium|1094124402-->
Per|li|nist der; -en, -en <zu ↑...ist>: a) Anhänger, Vertreter der radikalen Perlinisten die Perl als die einzig wahre Sprache ansehen; b) Mitglied einer perlinistischen Community.
ptk
 2004-09-02 17:29
#48968 #48968
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
t/0-signature....gpg: Signature made Wed Oct  8 16:29:54 2003 CEST using DSA key ID 06D8C374
gpg: requesting key 06D8C374 from x-hkp://pgp.mit.edu:11371 ...
gpg: can't get key from keyserver: Connection refused
gpg: Can't check signature: public key not found
Not in MANIFEST: blibdirs
==> MISMATCHED content between MANIFEST and distribution files! <==
# Failed test (t/0-signature.t at line 18)
# Looks like you failed 1 tests of 1.
t/0-signature....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay

Es sieht aus, als ob dieser Test verlangt, dass man online ist und keine Firewall den Traffic nach aussen abfaengt (jedenfalls fuer den ungewoehnlich Port 11371). Deshalb wuerde ich sagen: Testfehler ignorieren und trotzdem installieren.
schnapsfahne
 2004-09-03 08:48
#48969 #48969
User since
2004-09-02
2 Artikel
BenutzerIn
[default_avatar]
ach man sieht ja gar nicht um welches Modul es sich handelt.
ist das Convert::ASN1\n\n

<!--EDIT|schnapsfahne|1094187201-->
<< >> 4 Einträge, 1 Seite



View all threads created 2004-09-02 15:01.