artjuh
20th November 2002, 11:52
Does someone knows why ppl don't get an message if i use the command.
bshcmd6.1 -w1 -u1 -M "message" $USER_PID
with some script for the $USER_PID

Regards,
Artjuh

ssellens
20th November 2002, 13:32
Hi,

Could you expand on 'ppl' please.

Steve

patvdv
20th November 2002, 13:48
I think he means 'people' :)

artjuh
20th November 2002, 14:35
patvdv is Right.

I meant people. sorry i chat to much ;)

ssellens
20th November 2002, 16:27
Hi,

Check that your script is returning a pid number.
Also if $USER_PID is a script why not put bshcmd6.1 inside the script, or have the output of $USER_PID go to a file and then cat the file to bshcmd6.1 in a while loop.

Also it would be handy to see the script to know what is happening.


Steve

artjuh
20th November 2002, 16:37
echo "Welke gebruiker wil je een berichie sturen ?"
read user
echo "Tik je bericht."
read bericht

for i in `ps -eaf | grep bshell | grep -v grep | grep $user | awk '{print$2}'`
do
bshcmd6.1 -w1 -u1 -M "$bericht" ${i}
done

Hope you find something.
the user i was testing is bsp.

ssellens
20th November 2002, 17:00
Hi,

Have tested the script on my system and it works ok.
This now leaves the ? of environment but I am sure you would get a message from the system if there was a path or environment set wrong.

Can't think it would be a bw version or network problem.

Try setting the time for -w and -u to 2 seconds.

Steve

artjuh
20th November 2002, 17:20
#!/bin/sh
# Your enviroment
cd /baan/bse
. ./setbse
# SCRiPT
echo "Which user should get an message ?"
read user
echo "Type your message."
read message

for i in `ps -eaf | grep bshell | grep -v grep | grep $user | awk '{print$2}'`
do
bshcmd6.1 -w1 -u1 -M "$message" ${i}
echo "message: $message has been send to pid. ${i}"
done

This Script works on my server.
Sun Fire v880
Solaris 9

ssellens
20th November 2002, 17:28
Hi,

Its working :) thats great.

My system is a V880 too but Solaris 8.

How is the script different from what you were using?


Steve

JamesV
20th November 2002, 18:33
The problem may also be on the target process side.

If the bshell is busy (waiting on a DB process for example) the message will not work.

I am assuming that you were just testing with a trivial process. So this is probably not it.

OmeLuuk
21st November 2002, 11:39
Indeed too busy bshells have no time to respond to the bshcmd command. One way to try to work around this is to try the command again with longer wait times when the command is exiting with a "not succesfull" exit code... provided there is one... test the ${?}...

You will not be able to reach real hanging bshells.