Termination on receipt of SIGTERM

When a user cancels a running job with qcan, the command passes the request to the qdaemon.

The backend must stop the print soon after receiving the signal. There are two ways to accomplish this.

First, the backend cannot do anything special about SIGTERM, in which case the signal stops the backend process immediately. This option is the simplest, but it does not allow the backend to do any cleanup (reset line speeds, put paper at top-of-form, hang up the phone) before it terminates.

Second, the backend can catch SIGTERM, carry out whatever cleanup tasks are required, and exit EXITSIGNAL (#include <IN/standard.h>). The special exit code tells the qdaemon that the job was canceled.

Backends that decide to catch SIGTERM should exit very soon after receipt of the signal.

See the qcan command and the qdaemon command for more information.