1 .\" Copyright (c) 2013 Advanced Computing Technologies LLC
2 .\" Written by: John H. Baldwin <jhb@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Dd September 19, 2013
33 .Nd "protect processes from being killed when swap space is exhausted"
40 .Fl g Ar pgrp | Fl p Ar pid
44 command is used to mark processes as protected.
45 The kernel does not kill protected processes when swap space is exhausted.
46 Note that this protected state is not inherited by child processes by default.
49 .Bl -tag -width XXXXXXXXXX
51 Remove protection from the specified processes.
53 Apply the operation to all current children of the specified processes.
55 Apply the operation to all future children of the specified processes.
57 Apply the operation to all processes in the specified process group.
59 Apply the operation to the specified process.
63 as a protected process.
66 Note that only one of the
70 flags may be specified when adjusting the state of existing processes.
74 Mark the Xorg server as protected:
76 .Dl "pgrep Xorg | xargs protect -p"
78 Protect all ssh sessions and their child processes:
80 .Dl "pgrep sshd | xargs protect -dip"
82 Remove protection from all current and future processes:
84 .Dl "protect -cdi -p 1"
88 If you protect a runaway process that allocates all memory the system will