Hacker News new | ask | show | jobs
by lstyls 3115 days ago
> that seems useful.

It's useful like an atom bomb is useful - a really heavy-handed approach. Usually this is a smell that indicates forking processes are not communicating well.

It's much better to have well-behaved processes. Send SIGTERM to the parent process, allow the parent to perform cleanup of its own children recursively.

1 comments

> It's useful like an atom bomb is useful

It's intended for when you reboot the system, to get every process to quit. And for when you logout, to close everything you have running.

So yes, useful.

Wut?

When logging out via the OS supplied method this is handled for the user. Why on earth would a user have to call kill -1 on logout?

My comment was from the perspective of an application developer.

`kill(-1, ...)` is a syscall, it's not an application command.

> this is handled for the user.

And that's how - they call that syscall.

Maybe you didn't realize. Notice the parenthesis? It's a function call in a programming language. The command line program is just a passthrough to the syscall.

And when rebooting you do need the command line program, so preventing it from passing -1 through doesn't make sense either.