Question on Linux Binary

Hi All,

On linux system copied a /bin/kill to /bin/killlatest, when i tried to kill a command using /bin/killlatest it is failing with below errors

/bin/killlatest 12345
ERROR: no "killlatest" support.

Please help on this.. My ideas is to write a wrapper over killl command to find out who invokes the command from which machine and port.

The command expects to be named 'kill' and apparently checks for this. It's not unheard of. Some commands, like busybox, incorporate many programs in one executable, and test what name they're run as for what program to be.

Writing a script wrapper for 'kill' is a bad idea, since many system commands will want 'kill', and changing it in any way may break them. Use an alias instead, aliases will only work for logged-in users.

I moved all the kill command in /bin,usr/bin and what ever location wheris kill returns.

My path is also set to /usr/bin where there is no kill .. but when i run the kill command it is executing

kill 123456
-bash: kill: (123456) - No such process

which kill
which: no kill in (/home/dbbuser/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/dell/srvadmin/bin)

dbbuser@sn7024192-dbb4u:~> sleep 400 &
[1] 2282
dbbuser@sn7024192-dbb4u:~> kill 2282
[1]+ Terminated sleep 400

Please throe some light on this .. I am clueless...

Your shell has a builtin kill. An example using BASH:

$ echo $BASH_VERSION
4.2.24(1)-release
$ which kill
/bin/kill
$ type kill
kill is a shell builtin
$ type -a kill
kill is a shell builtin
kill is /bin/kill

Note that the builtin is preferred over the external binary.

Regards,
Alister

You really should undo that before something really bad happens. Your system needs that!

Thanks for the info, I have reverted the changes.