man.bsd.lv manual page server

Manual Page Search Parameters

PROTECT(1) General Commands Manual PROTECT(1)

protectprotect processes from being killed when swap space is exhausted

protect [-i] command

protect [-cdi] -g pgrp | -p pid

The protect command is used to mark processes as protected. The kernel does not kill protected processes when swap space is exhausted. Note that this protected state is not inherited by child processes by default.

The options are:

Remove protection from the specified processes.
Apply the operation to all current children of the specified processes.
Apply the operation to all future children of the specified processes.
pgrp
Apply the operation to all processes in the specified process group.
pid
Apply the operation to the specified process.
command
Execute command as a protected process.

Note that only one of the -p or -g flags may be specified when adjusting the state of existing processes.

The protect utility exits 0 on success, and >0 if an error occurs.

Mark the Xorg server as protected:

pgrep Xorg | xargs protect -p

Protect all ssh sessions and their child processes:

pgrep sshd | xargs protect -dip

Remove protection from all current and future processes:

protect -cdi -p 1

procctl(2)

If you protect a runaway process that allocates all memory the system will deadlock.

September 19, 2013 FreeBSD-12.0