In a perl script invoked by nginix/ FCGI , if I do this ssh user@ip <command>, it works i.e. ti connects to remote machine
However, if I do this expect->spawn(ssh user@ip ), FCGI returns an error on doing a open (That code is pretty generic and I don’t expect bugs in it).If I run the script using expect as a standalone, it works.
That leads me to believe that FCGI perhaps does not allow process to be spawned by expect. Though I am not sure. Googling has not helped so far. Any inputs appreciated
In a perl script invoked by nginix/ FCGI , if I do this ssh
Share
The reason it fails is because Expect.pm tries to dup STDIN and FCGI.pm doesn’t support the operation, next release of FCGI.pm will have a more clear error message than:
Not a GLOB reference at /path/to/perl/lib/....The solution is to avoid using the globals: STDIN, STDOUT, STDERR and %ENV when doing inter-process communication.