On 2022-09-27, Ottavio Caruso <
ottavio2006...@yahoo.com> wrote:
> If I wake the laptop, it resumes without killing Xorg.
>
> What am I doing wrong?
The default signal sent by kill and pkill is SIGTERM. That's a catchable
signal; it's not guaranteed to be fatal. An application can ignore
the signal, catch it and do nothing, or catch it and precipitate into
an orderly shutdown --- executing millions of instructions more code
until it terminates. Even if the program is designed to catch SIGTERM
and terminate, something could go wrong between those two events
to thwart the developer's good intentions, like the program getting
stuck somewhere, waiting for some external event that never comes
or getting into an infinite loop.
To kill something for sure, you must use the SIGKILL signal.
A reasonable middle ground is to use SIGTERM first, then wait for some
reasonable amount of time so the application has a chance to do a
graceful shutdown, and then SIGKILL.
"kill" is the name of a system library function, and of a command.
But what that function and command do isn't killing; they are signal
sending functions that have been misnamed by Unix.
kill(pid, sig); // send signal number sig to process pid.
Sending a signal results in termination only when that is the
effect of the specific signal which is used.
You can't take words too literally in computing. E.g. "print" rarely
does anything with paper any more; "opening" a file is nothing like a
opening a door, job position or a bank account, etc.
--
TXR Programming Language:
http://nongnu.org/txr
Cygnal: Cygwin Native Application Library:
http://kylheku.com/cygnal