truss and /sbin/init

David Malone dwmalone at maths.tcd.ie
Thu Feb 9 05:55:37 PST 2006


On Thu, Feb 09, 2006 at 01:25:30PM +0100, Jens Trzaska wrote:
> Does you or perhaps someone else know why init is locked in core? Its
> not the case in 4.x and I can't see why a regular userspace process
> is locked. 
> Can someone explain that?

The 'L' flag in ps output corresponds to either the process being
locked or it being a system process. In this case, init counts as
a system process. It might be worth updating the documentation to
make this clearer.

Procfs only makes certain nodes available if it thinks you are
permitted to debug the process. This includes the mem file. The
way it chooses is:

	(p->p_flag & P_SYSTEM) == 0 && p_candebug(td, p) == 0

(This is in sys/fs/procfs/procfs.c - see the function procfs_candebug)

I'm not sure why it rejects system processes explicitly - I think
the p_candebug call should be enough, but maybe I've missed something.
I'd suggest that you replace the test above with:

	p_candebug(td, p) == 0

then recompile and reinstall your procfs module.

	David.


More information about the freebsd-stable mailing list