Which command is best?

You have been asked to do an orderly shutdown on a process with a PID of 1234, with the kill command.
Which command is best?

You have been asked to do an orderly shutdown on a process with a PID of 1234, with the kill command.
Which command is best?

A.
kill -2 1234

B.
kill -15 1234

C.
kill -9 1234

D.
kill -1 1234

Explanation:
On POSIX-compliant platforms, SIGTERM is the signal sent to a process to request its termination. The
symbolic constant for SIGTERM is defined in the header file signal.h. Symbolic signal names are used because
signal numbers can vary across platforms, however on the vast majority of systems, SIGTERM is signal #15.
SIGTERM is the default signal sent to a process by the kill or killall commands. It causes the termination of a
process, but unlike the SIGKILL signal, it can be caught and interpreted (or ignored) by the process. Therefore,
SIGTERM is akin to asking a process to terminate nicely, allowing cleanup and closure of files. For this reason,
on many Unix systems during shutdown, init issues SIGTERM to all processes that are not essential to
powering off, waits a few seconds, and then issues SIGKILL to forcibly terminate any such processes that
remain.



Leave a Reply 0

Your email address will not be published. Required fields are marked *