camilla
22nd April 2008, 13:38
Hello,
i have a problem to use bshcmd6.1; i have created a program in BaaN, following the instruction that i find in this forum; now i want to kill a bshell PID, using
ret = shell("/appl/B4c4/bse/bin/bshcmd6.1 -e -u1 -w1 " & str$(tccom995.pid), 0)
But even if I use bsp to run the program, ret = 1 and the Pid is still existing in Unix!
Have I to use root to execute the program? Or where I did a mistake? Please help me!
Thanks in advance
jclju1
22nd April 2008, 13:54
You must be root user if you want to kill process that you are not owner. This is from man kill:
A root user can stop any process with the kill command. If you are not a root
user, you must have initiated the process you want to stop.
camilla
22nd April 2008, 15:24
Thank you for answer. I know that if you use "kill" from a unix shell you need to be logged in as root, but if bsp use the command: bshcmd6.1?
NPRao
22nd April 2008, 20:18
I know that if you use "kill" from a unix shell you need to be logged in as root, but if bsp use the command: bshcmd6.1?
Refer to the man chmod
permission One or more of the following letters:
r Add or delete the read permission for who.
w Add or delete the write permission for who.
x Add or delete the execute file (search
directory) permission for who.
s Add or delete the set-owner-ID-on-file-
execution or set-group-ID-on-file-execution
permission for who. Useful only if u or g
is expressed or implied in who.
You can set the superuser bit id to root and also maintain the sudo list of user who can use it.
Example:
$ ls -l | grep root
-rwsr-xr-x 1 root bsp 405504 Dec 27 16:27 badmin6.2
-rwsr-xr-x 1 root bsp 651264 Dec 27 16:27 blogind6.2
-rwxr-xr-x 1 root bsp 23638 Dec 27 16:27 lp6.2
-rwsr-xr-x 1 root bsp 4505600 Dec 27 16:27 pdaemon6.2
dave_23
23rd April 2008, 02:08
and bshcmd6.x does a soft kill of the bshell, so it will try to wait for the current process to finish before exiting. if your process is spinning or very long running it may never return.
Dave