Problem with "Daemon not connected"

I am having a problem with a script and hope someone here can help.

I have a Ruby script that includes an “open” method call to create a
subprocess and return a string. Shown here is a much simplified
version where I can recreate the problem.

$f = File.open("/tmp/foo.log", “a”)
#cmdline = "|ls -l"
cmdline = "|/opt/localname/bar …"
s = open(cmdline)
s.each do |line|
$f.print line
done

When this script is executed from the command line shell the "open"
method succeeds for the /opt/localname/bar program.

However, when the script is executed from within a shell script the
method fails.

Instead of printing the expected results the message “Daemon not
connected” is printed.

The “ls -l” command works in either situation.

I have reviewed the environment variables and there does not seem to
be anything relevant there. Any thoughts? Pointing out a stupid
mistake would be great!

This message is outputted from the ‘/opt/localname/bar’ application.
The conditions under which its run must somehow be different ?

Can you recall this “Daemon not connected” message if you invoke the
application manualy from the command line ?

···

On Wed, 11 Jun 2003 08:48:36 +0000, Andy Veitch wrote:

Instead of printing the expected results the message “Daemon not
connected” is printed.


Simon Strandgaard

Hi,

···

At Thu, 12 Jun 2003 00:32:37 +0900, Simon Strandgaard wrote:

Instead of printing the expected results the message “Daemon not
connected” is printed.

This message is outputted from the ‘/opt/localname/bar’ application.
The conditions under which its run must somehow be different ?

Can you recall this “Daemon not connected” message if you invoke the
application manualy from the command line ?

Or directly within shell script, rather than from ruby.

/opt/localname/bar … >> /tmp/foo.log

If you could reproduce same error, you’d better to ask the
author of the application.


Nobu Nakada