Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/protect/protect.1
Context not available. | ||||||||||
.\" | .\" | |||||||||
.\" $FreeBSD$ | .\" $FreeBSD$ | |||||||||
.\" | .\" | |||||||||
.Dd September 19, 2013 | .Dd May 18, 2021 | |||||||||
.Dt PROTECT 1 | .Dt PROTECT 1 | |||||||||
.Os | .Os | |||||||||
.Sh NAME | .Sh NAME | |||||||||
Context not available. | ||||||||||
or | or | |||||||||
.Fl g | .Fl g | |||||||||
flags may be specified when adjusting the state of existing processes. | flags may be specified when adjusting the state of existing processes. | |||||||||
.Pp | ||||||||||
Daemons can be protected on startup using | ||||||||||
.Ao Ar name Ac Ns Va _oomprotect | ||||||||||
option from | ||||||||||
.Xr rc.conf 5 . | ||||||||||
.Sh EXIT STATUS | .Sh EXIT STATUS | |||||||||
.Ex -std | .Ex -std | |||||||||
.Sh EXAMPLES | .Sh EXAMPLES | |||||||||
Context not available. | ||||||||||
Remove protection from all current and future processes: | Remove protection from all current and future processes: | |||||||||
.Pp | .Pp | |||||||||
.Dl "protect -cdi -p 1" | .Dl "protect -cdi -p 1" | |||||||||
.Pp | ||||||||||
Using | ||||||||||
.Xr ps 1 | ||||||||||
check if protect has been applied to the process: | ||||||||||
debdrupAuthorUnsubmitted Not Done Inline Actions
debdrup: | ||||||||||
.Pp | ||||||||||
.Dl "ps -O flags,flags2 -p 64430" | ||||||||||
.Pp | ||||||||||
.Dl " PID F F2 TT STAT TIME COMMAND" | ||||||||||
.Dl "64430 10104002 00000001 5 S+ 0:00.00 ./main" | ||||||||||
.Dl " ^P ^PI" | ||||||||||
.Pp | ||||||||||
In the bove example | ||||||||||
Not Done Inline Actions
debdrup: | ||||||||||
.Nm P | ||||||||||
points at the protected flag and | ||||||||||
.Nm PI | ||||||||||
points at the iheritance flag. The process is protected if | ||||||||||
.Nm P | ||||||||||
bit is set to 1. All children of this process will also be protected if | ||||||||||
.Nm PI | ||||||||||
bit is set to 1. | ||||||||||
.Sh SEE ALSO | .Sh SEE ALSO | |||||||||
.Xr procctl 2 | .Xr procctl 2 | |||||||||
.Xr ps 1 | ||||||||||
.Xr rc.conf 5 | ||||||||||
.Sh BUGS | .Sh BUGS | |||||||||
If you protect a runaway process that allocates all memory the system will | If you protect a runaway process that allocates all memory the system will | |||||||||
deadlock. | deadlock. | |||||||||
Context not available. |