Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9830 closed bug (invalid)

coretool - kill command not work properly

Reported by: streak Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/Development
Keywords: coretools kill command Cc:
Blocked By: Blocking:
Platform: All

Description

on hrev 45646 works properly while invoking "kill -9 Appname", but on haiku-nightly from 17 jun 2013 this wont work returning info "invalid process id".

kill command from 45646 is 38,63 KB kill command from 17 jun 2013 is 34,63 KB

Attachments (2)

kill (38.6 KB ) - added by streak 12 years ago.
Kill app from may - This is working one
kill.castrated (34.6 KB ) - added by streak 12 years ago.
This one is from june - Not working properly.

Download all attachments as: .zip

Change History (9)

by streak, 12 years ago

Attachment: kill added

Kill app from may - This is working one

by streak, 12 years ago

Attachment: kill.castrated added

This one is from june - Not working properly.

comment:1 by anevilyak, 12 years ago

Component: - GeneralApplications/Command Line Tools
Version: R1/alpha4.1R1/Development

/bin/kill isn't what gets invoked, the shell builtin is. In any case, works over here on hrev45774, so I'm afraid you'll need to provide a more specific example.

comment:2 by streak, 12 years ago

Please check these two biniaries that i attached..

my output from both of them:

> ./kill.castrated -9 WebPositive
./kill.castrated: WebPositive: invalid process id

(this one has issue. This command couldnt kill WebPositive)
[Fri Jun 21 18:32][user@shredder][/Dev/system/bin]
> ./kill -9 WebPositive

(this one was executed properly and kills webpositive)

comment:3 by anevilyak, 12 years ago

As I already said, /bin/kill no longer handles that, bash's builtin kill does since coreutils kill cannot handle killing jobs (c.f. ticket #9687).

To illustrate:

~> type kill
kill is a shell builtin
~> ps | grep WebPositive
/boot/apps/WebPositive                              2194        7    0    0
/boot/common/bin/grep --color=auto WebPositive      2963        1    0    0
~> kill -9 WebPositive
~> ps | grep WebPositive
/boot/common/bin/grep --color=auto WebPositive      2965        1    0    0
~> uname -a
Haiku leviathan 1 hrev45774 Jun 13 2013 18:21:56 BePC Haiku

comment:4 by streak, 12 years ago

If i spawn process '/bin/kill -9 someapp' from external GUI app [for example from app done in lazarus, that not calls bash] kill will not quit/kill process [i already checked that... it wont work on newest revisions]. So basicaly now command /bin/kill spawned from GUI app via process command is useless.

comment:5 by anevilyak, 12 years ago

Resolution: invalid
Status: newclosed

Why would something like lazarus need to invoke /bin/kill at all, rather than using kill_team()? There's really no good reason to do it that way, especially since kill processname isn't reliable when multiple teams with the same name exist, in which case which one gets killed is a matter of luck, so if you're looking to kill specifically the instance you presumably spawned, then you really shouldn't be doing it that way at all.

comment:6 by streak, 12 years ago

Its done in this way because of:

  • Portability in lazarus app for haiku / different flawors of linux
  • kill_team() which is used pfor example in processcontroller not always kills properly zombie apps [from my experience, zombies are hard to kill using processcontroller. The opposite -kill command works perfectly with lazarus and i dont need to do any fancy stuff to use it on linux and haiku..

in reply to:  6 comment:7 by anevilyak, 12 years ago

Replying to streak:

Its done in this way because of:

  • Portability in lazarus app for haiku / different flawors of linux

That makes no sense. coreutils kill does not support kill by name on linux either. Kill by PID on the other hand is more reliable and supported on both.

  • kill_team() which is used for example in processcontroller not always kills properly zombie apps [from my experience, zombies are hard to kill using processcontroller. The opposite -kill command works perfectly with lazarus and i dont need to do any fancy stuff to use it on linux and haiku..

That makes no sense either, since kill_team() is equivalent to sending kill -9 to the team.

Note: See TracTickets for help on using tickets.