in reply to Running Linux PovRay, Shell's okay but cron won't play

Anybody know a work around for faking an ssh session via perl? You mean like ...
system("ssh -l theuser thehost povray ./gigtown.pov +W600 +H300");
Is povray going to pop-up a window that is 600x300 or is it going to generate a image file of some sorts? If it is going to popup a window you might need to set the DISPLAY environment variable because I bet that is not set for cronjobs.

Plankton: 1% Evil, 99% Hot Gas.

Replies are listed 'Best First'.
Re: Re: Running Linux PovRay, Shell's okay but cron won't play
by true (Pilgrim) on May 21, 2004 at 23:01 UTC
    hmm, i tried this but was unable to login via a system command. Looked at help for ssh but no password accept method. Thanks for showing me that ssh was right in front of me though.

    I take it maybe open2 will allow me to negotiate this? trying to pass ssh a password yields me errors of "Pseudo-terminal will not be allocated because stdin is not a terminal." or "Broken Pipe". :(

    Thanks for info, i do not know how to set the DISPLAY environment variable. PovRay is outputting the render to a png file, i only need it to do that. I have set povary variables for non display. Still problem is before that, in accepting parameters via automated perl. thanks for help.

    jtrue
      funny story, a monk said to me yesterday "the answer is so obvious i'm not going to tell you". well, the answer was "use_pty", and it took me 12 hours to find it :) I solved this by using the Net::SSH::Perl of important note is use_pty to get povray to work right. This sets a pseudo tty on your remote machine. Without a proper tty, povray will not render. So if you are trying to emulate a shell, for any reason, this may be a solution for you.
      #!/usr/bin/perl-w use strict; use Net::SSH::Perl; my $host = "111.111.111.111"; my $user = "usernm"; my $pass = "passwd"; my $cmd = "povray +I/mypath/gigtown.pov"; my $ssh = Net::SSH::Perl->new($host,use_pty=>1); $ssh->login($user, $pass); print $ssh->cmd($cmd); exit;
      Final recap for povray/perl folks If you want to automate povray from outside your system. The hurdle is faking a shell. My solution involves running the above perl code inside a root crontab. This was the only solution i could come up with save from recompiling povray.
      jtrue