From: "Ara.T.Howard" Date: 2004-10-16T08:44:28+09:00 Subject: Re: [Q] drb, Session::Bash & FreeBSD On Fri, 15 Oct 2004, Benny wrote: benny- some random thoughts... > 2. # uncommented > # set -x to > set -x i would definitely comment that out for now... > 3. adjusted the Constants to fit to my repos / authentification would the authentification be using anything like ssh-agent or somethig not running when started via rc.d? any other reason it would prompt when there is no tty? def execute_shell_commands(id, command_array) command_array.each { | cmand, title | cmd =cmand.gsub('"', '\"') # # this could be a problem - eg, WILL be a problem in some cases # test = `echo '#{cmd}' >> /var/log/session_exec` stdout, stderr = Session::Bash::new.execute "#{cmd}" # => result = `#{cmd}` works result = "RESULT:\n#{stdout.to_s}" test = `echo '#{result}' >> /var/log/session_exec` result << "\nERROR:\n #{stderr}\n" if stderr.to_s != "" } return true end > the first entry in /var/log/session_exec is the correct command. > the second entry never gets into /var/log/session_exec, in fact when calling > the script simply by its path, it never seems to finish. when I call it > with an ending & (in the background) I never get something back. this could be explained by the gsub munging the command so that bash is still looking for a closing quote or something. this would explain why even test = `echo '#{cmd}' >> /var/log/session_exec` does not work at times - if the quoting in cmd had become corrupt bash might just be waiting.... -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================