From: benny Date: 2004-10-15T18:24:33+09:00 Subject: [Q] drb, Session::Bash & FreeBSD Dear list, I am using a kind of session-daemon who receives messages via drb and sometimes it has to execute shell commands based on the message and to return the result to the caller. now i got 2 problems: ------------------ 1. problem Inside the session-daemon I used result = `#{cmd}` to execute the command and it worked quite well. however I wanted to get the error-messages as well, so I considered using Session::Bash: stdout, stderr = Session::Bash::new.execute "#{cmd}" for most command that works fine, but I have a shell script (first line /usr/local/bin/bash) which returns some messages using "echo". this messages never get into stdout (the new way) but the get back to result (the old way). I also tried "/usr/local/bin/bash myshellscript" but that didn't work ether. what am I missing? ------------------------ 2nd problem (maybe only FreeBSD related) the normal way to automatically start a service on system start in FreeBSD is to have shell script in /usr/local/etc/rc.d/ (say /usr/local/etc/rc.d/session_daemon_starter.sh) which respond to the parameter 'start' (and to 'stop' for the shutdown). I did this several time: no prob. the corresponding line in 'session_daemon_starter.sh' says path_to_my_session-daemon & to start it in the background. in 'path_to_my_session-daemon' itself the first line is #!/usr/local/bin/ruby as usual. when I start 'session_daemon_starter.sh' by hand, e.g. /usr/local/etc/rc.d/session_daemon_starter.sh start everything is working fine: the session-daemon is running, accepting messages via drb, sending messages via drb and sometimes executing shell-commands based on the messages it receives. when 'session_daemon_starter.sh' is automatically started with the system start the session-daemon is running, accepting messages via drb, sending messages via drb but doesn't execute any shell commands: neither via result = `#{cmd}` nor via stdout, stderr = Session::Bash::new.execute "#{cmd}" what am I missing? thank you for any response, benny