Testing if a process is protected

chris chris at bsdjunk.com
Thu Nov 27 08:41:26 UTC 2014

ps -O flags
flags     The flags associated with the process as in the include file
P_PROTECTED          0x100000      Do not kill on memory

[chris at pcbsd-chris] ~% ps -O flags,class 
 3476 10104002 daemon  0  Ss   0:00.25 csh
11072 10004002 daemon  0  R+   0:00.00 ps -O flags,class
[chris at pcbsd-chris] ~% 

csh is protected ps is not ? hope this helps some :P

Chris Petrik
FreeBSD Developer
E on FreeBSD
As in certain cults it is possible to kill a process if you know its true name.
-- Ken Thompson and Dennis M. Ritchie

---- On Thu, 27 Nov 2014 02:12:47 -0600 Moreno Carullo<moreno.carullo at nozominetworks.com> wrote ---- 
 > Hi all, 
 > I am implementing a set of automated tests for my FreeBSD system, and I would like to verify that a specific process has been protect(ed) (https://www.freebsd.org/cgi/man.cgi?query=protect&sektion=1). 
 > How can I verify that a given PID has been protected ? 
 > Thanks, 
 >   Moreno 
 > _______________________________________________ 
 > freebsd-questions at freebsd.org mailing list 
 > http://lists.freebsd.org/mailman/listinfo/freebsd-questions 
 > To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org" 

More information about the freebsd-questions mailing list