Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Aug 2018 09:25:37 +0200
From:      "Patrick M. Hausen" <hausen@punkt.de>
To:        Mark Johnston <markj@freebsd.org>
Cc:        David Powers via freebsd-virtualization <freebsd-virtualization@freebsd.org>, freebsd-dtrace@freebsd.org
Subject:   Re: Why can't I dtrace processes running in a jail from the host?
Message-ID:  <5BD4792C-D8AB-4598-BE7A-9D63A5757392@punkt.de>
In-Reply-To: <20180810183419.GA52302@raichu>
References:  <FB08F1C9-C066-4C78-8D35-E2A522ADC8F8@punkt.de> <20180809145258.GA68459@raichu> <8B1BDE9F-BDAD-4CEB-B7A2-8052497F50EA@punkt.de> <20180810183419.GA52302@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help
Good morning,

I did some further investigation and with help from Mark was
finally able to get it working.

Took quite some effort - documentation on the PHP side - NULL :-/
BTW: has anyone ever successfully subscribed to one of the PHP
mailing lists? Where is the community of the people developing that
stuff?

OK, back to topic, in fact I had two issues, one FreeBSD, one PHP
related.

1.	DTrace'ing jailed userland probes requires /dev/dtrace/* to
	be visible inside the jail.

Hence:

	[devfsrules_proserver=3D100]
	add include $devfsrules_jail
	add path dtrace/* unhide

	iocage set devfs_ruleset=3D100 vpro0069

Voila - dtrace on the host, watch userland probes in the jail.

2.	PHP > 5.6 needs the environment variable USE_ZEND_DTRACE
	to be set to register it's probes.

Turned out that it was not sufficient to *configure* that into the PHP
FPM worker but you need to set (and export) the variable on the shell
before you start the FPM master daemon. Then everything works as =
expected.

What I regularly do in such a case is

	sh -x /usr/local/etc/rc.d/php-fpm start

to find out what command is actually executed in the end. Then call that =
directly
after setting the environment. Result:

	setenv USE_ZEND_DTRACE 1
	limits -C daemon /usr/local/sbin/php-fpm

Bingo! Surprisingly enough it is *not* necessary to configure

	clear_env =3D no

in PHP FPM ... DTrace is active as soon as the master daemon sees that
environment variable.

Kind regards
Patrick
--=20
punkt.de GmbH			Internet - Dienstleistungen - Beratung
Kaiserallee 13a			Tel.: 0721 9109-0 Fax: -100
76133 Karlsruhe			info@punkt.de	http://punkt.de
AG Mannheim 108285		Gf: Juergen Egeling




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5BD4792C-D8AB-4598-BE7A-9D63A5757392>