From: Jeremy Bopp Date: 2010-10-22T10:00:34+09:00 Subject: Re: How to pass/return a string to calling program? On 10/21/2010 06:12 PM, Tony De wrote: > Jeremy Bopp wrote in post #956168: >> On 10/21/2010 3:20 PM, Tony De wrote: >>> client. In ruby I've tried without success: >>> >>> puts msg_string >>> exit >>> >>> print msg_string >>> exit >> >> These should definitely work. >> >>> at_exit {print msg_string} >>> exit >>> >>> at_exit {puts msg_string} >> >> I haven't had a need to use at_exit before, but I suspect that these >> should also work. >> >> Have you tried directly running your scripts by hand to confirm that >> they output something at all? If they are printing something, try >> making stdout and stderr synchronous rather than buffered in your >> scripts: >> >> $stdout.sync = $stderr.sync = true >> >> -Jeremy > > Jeremy > > I am definitely getting output (a simple OK for testing): > root@smi2-new:/usr/local/services/secure_dir# ./service_prov > ../config_files/pms.2006.66056308205 > OKroot@smi2-new:/usr/local/services/secure_dir# > > I tried the sync option, but client didnt' get the response. My perl > script does... Are you certain that your Ruby scripts are even running? What is the exit code your server gets back from running the scripts, and is that result expected? Do you have any way to independently confirm that your server is actually running your scripts? If not, you might try modifying one of your scripts to have it create an empty file in a well known location which you could then check for existence after triggering your script to run. -Jeremy