muheeb
8th August 2002, 12:10
Hi all,
I need to use this command in order to kill the whole
bshell and/or process in it.
But I tried it and it only kills the current bshell I run,
and not another bshells??
it's syntax suppose to be: bshcmd6.1 -e <bshell_id>
and I take <bshell_id> from "licmon6.1 -w"
HELP.
ssellens
8th August 2002, 13:08
Muheeb,
Is this on a Unix system? if so are you using this command as root? if not you will find you have no permissions to kill other users processes. Also if you want to kill all users on a system you are better off using alg6.1 to do the job, again as root.
Hope this helps
Steve
muheeb
8th August 2002, 13:22
Hi Steve,
thanks for your quick reply.
I have Baan4b, and yes it's UNIX system! why it will be different
in NT systems?
you mean just I can kill other bshell using "bshcmd6.1 -e"
just as a root? what if I want to do the killing from Baan itself.
when I tried it from baan (running "bshcmd6.1" using "shell" function in a script) it just killed itself!
ssellens
8th August 2002, 13:36
Muheeb,
Not sure on NT so can't say what the difference would be, think you have to be an administrator or have admin permissions.
If I am reading the bshcmd correctly yes the -e switch will allow you to kill all bshells when used by root. But if you are doing it from a bshell ie in a session or run sh from menu then it will pick up your user name and only kill your bshell.
Steve
muheeb
8th August 2002, 13:55
Steve.
Do you have Baan4c or later? could you try it for me?
I discover something interesting when I run "bshcmd6.1"
from outside "telnet"..
if I run "bshcmd6.1 -e" to kill bshell of Baan4b
from telnet (loged as bsp) it won't kill any process.
BUT I have also Baan4c with 1 user (bsp) only, so I run
"bshcmd6.1 -e" from telnet trying to kill this only bshell
I have in Baan4c and it did kill it!!
so I assume that it would work in Baan4c, that's why if I have
Baan4c or later and you have more than 1 license in it, could you try it??
Thanks a lot.
ssellens
8th August 2002, 14:10
Hi again,
Something you need to be aware of, BSP user at the unix level is a normal user, as such if they were not logged in on your baan4b system in Baan it would not kill any bshells. So on your baan4c system the user is the same and is removed. I can try the bshcmd on our test system, but it might not be today as it is in use, and I value my job to much to do it on the live system at the moment, that will have to wait till I have another job lined up :)
Steve
muheeb
8th August 2002, 14:13
Anyway thanks a lot... I guess you are right it won't work
just as root.
The only solutation is writing a script that can switch
to root, kill and return back:)
Thanks.
ssellens
8th August 2002, 14:18
Hi,
Slight error in that, the connection to root will be via a bshell still, this bshell will be killed along with the rest and your connection will be lost as well. A better way is to write a shell script in Unix to look for and kill the bshells, however this can be dangerous as this could leave tables and records locked. What database are you using? and for what reason do you need to kill the bshells?
Steve
muheeb
8th August 2002, 14:22
I wrote an administration program that can show you a list
of current users, so you can choose one or more in order to:
1. send instant messages, 2. show session/process they run in Baan... and also I want to have the ability for BSP to kill.
and yes I meant of course a UNIX shell script to do the
switching.
ssellens
8th August 2002, 14:31
Hi,
Sorry thought you were still talking about a baan session script.
As for 2 of the 3 things you want to do, send a message and kill the users bshell, alg6.1 will do that. As for what the user is running, unless your users are using ba6.1 (ascii) and not bw (windows) I don't think you can, but have never tried to look so am not 100% sure on that.
Anyway best of luck, but I would recommend you have a look at alg6.1, even the script might give you some pointers.
Steve
KO.SA.
26th September 2002, 13:10
hi for all
Try to use it:
ps -ef| grep bshell
It show you the currents bshells and their pids...
after use it to kill them:
bshcmd6.1 -u1 -w1 -e PID
also you can use this commando to see the users processes..
bshcmd6.1 -u1 -w1 -p -s PID
ssellens
26th September 2002, 13:18
Well you learn something new everyday in this job.
Nice one KO.SA.
Steve
dstegink
4th October 2002, 18:35
check out all options for bshcmd, use bshcmd6.1 -U and/or bshcmd6.2 -U
You can see processes on a bshell, and kill just one process running on a different bshell, among other things.
fyi - alg6.1 is a unix script that is not part of the porting set. It is useful for sending messages and sending kill signals to bshells.
Also, at least with bshcmd6.2 (5.0c), you need to be root to list processes, kill processes and send kills to bshells.
I've attached my own bshcmd script to give you an idea of what you can do. This has only been run on a 6.2 porting set on a Sun ksh. Good luck, and please post back any feedback on this script.
mbadillo
12th October 2002, 01:15
What's the format of bshcmd6.2 command in AS/400?
Mario
NPRao
12th October 2002, 03:35
Ok guys, here is a simple solution and please use the search options on the Board for reference.
#*************************************************
# Platform : UNIX
# Copyright 2002 - by N. Prashanth Rao
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice
# appear in all copies and that both that copyright notice and this
# permission notice appear in supporting documentation.
# N. Prashanth Rao and Baanboard.com DISCLAIM ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS, IN NO EVENT SHALL N. Prashanth Rao nor
# Baanboard.com BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
# THE USE OR PERFORMANCE OF THIS SOFTWARE.
#*************************************************
# Shell script to kill all users in for a particular bshell
# Author: N. Prashanth Rao
#*************************************************
# Shell Script for killing all BaaN Logins in an environment
# Only Super Users - BSP/ROOT are authorized for killing the users
# Author : N. Prashanth Rao
if test $LOGNAME = "bsp" -o $LOGNAME = "root"
then
if test $# -ne 1
then
echo "Command Usage: bkillall bshell_abcd"
exit
fi
clear
for i in `ps -ef | grep $1 | grep -v "grep bshell"|awk '{print $2}'`
# add another grep before awk if based on user id
do
echo "Killing Process ID - ${i} \n"
kill -9 $i # Sure Kill
# kill -15 $i # Software Terminal Signal
done
else
echo "Only-BSP/ROOT are authorized to use the BaaN Login Killer\n"
fi
1. You need to have superuser id bit turned ON to be executed by bsp or root login should be used.
2. Please be careful to use the kill -9 option, safe option is kill -15.
Refer to the other postings -
CODE: Show which session a user is running (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1936)
> Sending broadcast message in GUI (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5634)
Backup procedure (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5397)
Restart Licence Deamon (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5451)
You might also check the print job process or any background socket programs, for a proper shutdown of an environment -
ps -ef | grep pdaemon6.2 [your version]
and
ps -ef | grep ba6.2 or bshell6.2 [your version]
Do not use kill -9 (sure kill). This may be adversely affecting the license manager. Please use kill -15 (software termination kill).
What's the format of bshcmd6.2 command in AS/400?
use the help options based on your version, OS etc.
$BSE/bin/bshcmd6.2 -?