On Fri, 15 Oct 2004, benny wrote:



benny-

it's tough to say what might be happening but it sounds like a path/permission
error.  eg.  when your script is started via rc.d it's started at root and
that has some implications.  as to the first problem i am also unsure of what
to say, can you post the the script called and the script that calls it using
Session::Bash.  i've not had any bug reports about Session - but that sure
doesn't mean there aren't any and i'd love to diagnose this.  btw i'm heading
out of town for a week in two days so send them pronto if you want me to look
at them.

kind regards.

-a



> 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
>

-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
===============================================================================