From owner-freebsd-jail@freebsd.org Wed Sep 18 19:40:39 2019 Return-Path: Delivered-To: freebsd-jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE2DF1258C4 for ; Wed, 18 Sep 2019 19:40:39 +0000 (UTC) (envelope-from jazzlover@gmx.net) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46YVh65Dx2z3Bxm for ; Wed, 18 Sep 2019 19:40:38 +0000 (UTC) (envelope-from jazzlover@gmx.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568835626; bh=w9skdbvkMWHSvvVTIh0OpPq2a3BvXDCxR75p02HMBMA=; h=X-UI-Sender-Class:From:Subject:To:Date; b=WbqvxpqeE+HrrlGsQhCqBmbH2M84uVNlh/g9Pe4FZk35C1QBsKNgtsdQd71AsBU/u qFbBHkWNFqiMxnw1hfKiy7KWNqgLC2AH1vPTJWYGazKFvGizIbcc/wKk7pPgrKMr5S QrOl66u1h8qb6C/wBD4FOmX/7F9IJytRPYGQPL9A= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.102] ([188.104.139.96]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MSp1l-1icY4G1kub-00RoHj for ; Wed, 18 Sep 2019 21:15:49 +0200 From: Jazzlover Subject: A process survives a restart of the jail in which the process reside. How so? To: freebsd-jail@freebsd.org Message-ID: <0f6de6a5-c588-e324-67c3-db43c8bb03bb@gmx.net> Date: Wed, 18 Sep 2019 21:15:49 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AJ4DQSs1ukva9igkOh4kPwR1qZXYfaj+BLkmrxW+SolmE+mdPic 7Wg7k0Ya3YGPYSoUOjKkGjdqI3iiX7HXM1a86hVPbSolKlQRWRXcgi5zb3AuXPG3CkWVkx8 m1Sb3m3QubjhnWZrXL8hoUTBBgnpFerFX5HFWomsYe4GDg+OHU8+eiH+wSKmGYSRiQBm8QM c3zJkofs+lVfbwxew8tuw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:H4xSSKoiuF4=:pf8JxowCNRTa1q9VIpgdjM tGViDRdGiKGg5oH16U0f1vVprh1xx+YSUoAnw/DMQ/srYU2C8x9x17iKrzlkaYMPP9qiVnhQz gTlR0WioaBsSLSvSrLAbvyreoIxgOzt3V9B2LkJGk7wDRQ56eX4G5F148S5H86CpJVVCNcyc7 isHhB03Qe02o8TlVJq270PzM4v2coiWduulBCIr8l01+v06rSkENCCfYgRL7ToYZ0ZBbO0Ldm zJeBi8mNUiLLn6aQVnuAIWx6TotE3lHqo80GiJmps/w0zFMVbfrfbmTaC6R3BCbDJDP4IAxXQ TEhh7/0ua9h4k3896a3IuWYyWcWvIw0x55FXFxSrXuMjgf2K5Sk/h8zFaEOOhQOV2UwB8O531 X4Jbo6oyF4Nc/g7WmVjG4SQ5QBGZrBBWQ9Bz7cuOaqPRCRqP57zZ+bZd42SaltIMW8+2kf35+ j5yeIWP6l6Yq+/ncPwOneiOuC6CRqcXmLDwLikWFTuhXYfhBeJ8iIl9oRaoU4F37Cl/JYsj1o A0Rt8ne/ZWsSfj/kg9uncKE53RW7hjzu8Gc2iMq23pz6TDCm21rnNSaf02dAdb+G10d/WaiCw mKJX9qpV4h4x3mkjlQMeNZ5XsFNs2ScUqkSZOiP5yrq9Cyed9jF/irLSzFi6hxT1JCV5SxpaP IuHw8zkPFmhI8QArItrOdDaHnqz3K5V+HXlKGbN1bYzZX8wYayjU+3U2Fg2NZgQoleoku5AIy JiQOHpw7lmMx4+qtCZz+ijK73HVNu2rYxwmRyYv+uaUzD0vZ6+ur0cw5zrxL8eT4tSFvC17do sBs429BwPnT7mUHrPXsbZuZL1OUS0NwyJBrAEcBnPhruE7IqdbCEtmZEmsrBP7yTboU902TEU Hqh5lVzwvs+9HIYDa0J+w/3r9unm3tnu/HL6lxfIskOamCPTYXpkomMBvRFIVbd8GWpxK/i51 pZkaF0QcPJqYPUULSeAVHLydpG37SIS+sarc7FDa22Gj8yZomozH70g7f1rApmv58yjA35x5j KAjfrKVa1YLGvu06eZvJd+BkgfIoXZ4KS4TacpMmGAH8S+Zm8sNF3YsBuCpRmG+6ExRHXeO2E Y2BsO7Yrj9QfvlF7HkFxwqWqFw3rqLwd3C3+4v1RTwTKFHYLmKWS8n0142IO++Ytldqqsn96K FJtwG6iASXPLyw3n7rdFsMt9UGke5VqJAE7xyRFZjqEdMTea+qMToFz47AldDWUzv2RxZzoS2 GXJdpO5ZcldfZc0CaE8AKa3yCgxHFEfiH3zTOoHTLmSTAoaGIgXPjM9zBrmE= X-Rspamd-Queue-Id: 46YVh65Dx2z3Bxm X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=Wbqvxpqe; dmarc=none; spf=pass (mx1.freebsd.org: domain of jazzlover@gmx.net designates 212.227.17.21 as permitted sender) smtp.mailfrom=jazzlover@gmx.net X-Spamd-Result: default: False [-1.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.227.17.0/27]; FREEMAIL_FROM(0.00)[gmx.net]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmx.net:+]; RECEIVED_SPAMHAUS_PBL(0.00)[96.139.104.188.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmx.net]; RCVD_IN_DNSWL_LOW(-0.10)[21.17.227.212.list.dnswl.org : 127.0.3.1]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmx.net.dwl.dnswl.org : 127.0.3.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-jail@freebsd.org]; DMARC_NA(0.00)[gmx.net]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(0.00)[ip: (-7.15), ipnet: 212.227.0.0/16(-1.36), asn: 8560(2.14), country: DE(-0.01)] X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2019 19:40:39 -0000 Hello there, Frankly, I am quite puzzled. I have synapse (matrix) server installed in a jail. When I restart the jail, the process not only survives the restart, but start itself once again as well. Before `service jail restart matrix` ``` 18:34 /root # ps -ax | grep synapse 71422 - SsJ 0:09.13 /usr/local/bin/python3.6 -m synapse.app.homeserver --daemonize -c /usr/local/etc/matrix-synapse/homese= r 71603 - IsJ 0:00.14 postgres: synapse_user synapse 10.1.1.8(17671) (postgres) 72397 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(39734) (postgres) 72575 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(48464) (postgres) 72821 - IsJ 0:00.18 postgres: synapse_user synapse 10.1.1.8(33224) (postgres) 73216 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(13992) (postgres) 74282 - IsJ 0:00.16 postgres: synapse_user synapse 10.1.1.8(33434) (postgres) 78655 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(43654) (postgres) 79232 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(43655) (postgres) 87376 - IsJ 0:00.13 postgres: synapse_user synapse 10.1.1.8(43663) (postgres) 88057 - IsJ 0:00.14 postgres: synapse_user synapse 10.1.1.8(43664) (postgres) 37713 1 R+ 0:00.00 grep synapse ``` After `service jail restart matrix` ``` 18:35 /root # service jail restart matrix Stopping jails: matrix. Starting jails: matrix. 18:35 /root # ps -ax | grep synapse 54382 - SsJ 0:00.23 /usr/local/bin/python3.6 -m synapse.app.homeserver --daemonize -c /usr/local/etc/matrix-synapse/homese= r 54694 - SsJ 0:00.01 postgres: synapse_user synapse 10.1.1.8(49926) (postgres) 54704 - SsJ 0:00.01 postgres: synapse_user synapse 10.1.1.8(34813) (postgres) 54898 - SsJ 0:00.00 postgres: synapse_user synapse 10.1.1.8(35987) (postgres) 55140 - SsJ 0:00.00 postgres: synapse_user synapse 10.1.1.8(48412) (postgres) 66998 - SsJ 0:00.01 postgres: synapse_user synapse 10.1.1.8(17246) (postgres) 71422 - SsJ 0:09.22 /usr/local/bin/python3.6 -m synapse.app.homeserver --daemonize -c /usr/local/etc/matrix-synapse/homese= r 71603 - IsJ 0:00.14 postgres: synapse_user synapse 10.1.1.8(17671) (postgres) 72397 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(39734) (postgres) 72575 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(48464) (postgres) 72821 - IsJ 0:00.18 postgres: synapse_user synapse 10.1.1.8(33224) (postgres) 73216 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(13992) (postgres) 74282 - IsJ 0:00.16 postgres: synapse_user synapse 10.1.1.8(33434) (postgres) 78655 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(43654) (postgres) 79232 - IsJ 0:00.15 postgres: synapse_user synapse 10.1.1.8(43655) (postgres) 87376 - IsJ 0:00.13 postgres: synapse_user synapse 10.1.1.8(43663) (postgres) 88057 - IsJ 0:00.14 postgres: synapse_user synapse 10.1.1.8(43664) (postgres) 37851 1 S+ 0:00.00 tail -f /jails/matrix/var/log/matrix-synapse/homeserver.log 67732 2 R+ 0:00.00 grep synapse ``` Please notice the process 71422 in both outputs. It looks like the process survived the jail restart (postgresql resides in another jail). As a result I have two synapse processes running with the same config in the jail, which just being restarted. BTW, if I restart the jail once again, I have three synapse processes... So, basically I have two questions so far: 1. Just out of curiosity, how is that possible - a residing in the jail process survives the jail restart. Is it common things and I missed something about jails? Or it is just for python (maybe another interpreter)? 2. How to solve this? Meaning force the jail behave as it should, meaning the processes in the jail should be restarted as far as the jail is restarted. I have posted more details in another thread here on the FreeBSD.org forum= : https://forums.freebsd.org/threads/py36-matrix-synapse-installation-almost= -working.72257/post-439752 From owner-freebsd-jail@freebsd.org Thu Sep 19 17:19:14 2019 Return-Path: Delivered-To: freebsd-jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC6E01295B1 for ; Thu, 19 Sep 2019 17:19:14 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z3VV0Qy6z439V for ; Thu, 19 Sep 2019 17:19:13 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id x8JHJ5d7046065; Thu, 19 Sep 2019 11:19:05 -0600 (MDT) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 19 Sep 2019 11:19:05 -0600 From: James Gritton To: freebsd-jail@freebsd.org Subject: Re: A process survives a restart of the jail in which the process reside. How so? In-Reply-To: <0f6de6a5-c588-e324-67c3-db43c8bb03bb@gmx.net> References: <0f6de6a5-c588-e324-67c3-db43c8bb03bb@gmx.net> Message-ID: <0a8c8db0dc4b172baec8fb49f1c9cd4c@freebsd.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.8 X-Greylist: inspected by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Thu, 19 Sep 2019 11:19:05 -0600 (MDT) for IP:'127.0.0.131' DOMAIN:'[127.0.0.131]' HELO:'gritton.org' FROM:'jamie@freebsd.org' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Thu, 19 Sep 2019 11:19:05 -0600 (MDT) X-Rspamd-Queue-Id: 46Z3VV0Qy6z439V X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:30247, ipnet:199.192.164.0/22, country:US] X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 17:19:14 -0000 On 2019-09-18 13:15, Jazzlover wrote: > Hello there, > > Frankly, I am quite puzzled. I have synapse (matrix) server installed > in > a jail. When I restart the jail, the process not only survives the > restart, but start itself once again as well. > > Before `service jail restart matrix` > > ``` > > So, basically I have two questions so far: > > 1. Just out of curiosity, how is that possible - a residing in the jail > process survives the jail restart. Is it common things and I missed > something about jails? Or it is just for python (maybe another > interpreter)? > 2. How to solve this? Meaning force the jail behave as it should, > meaning the processes in the jail should be restarted as far as the > jail > is restarted. It looks like you've answered #2 yourself, but this is still something that shouldn't be happening. The only time stopping a jail should result in the jail still existing with old processes is if those processes end up completely unkillable (which generally points to a different problem). I wonder if leaving the rc system out of entirely, and just restarting via jail(8) would change anything. Does a "jail -rc jailname" give any different results? > I have posted more details in another thread here on the FreeBSD.org > forum: > https://forums.freebsd.org/threads/py36-matrix-synapse-installation-almost-working.72257/post-439752 >> It turns out, that I made a mistake in /etc/jail.conf - in the new >> jail section didn't wrap the IP in quotes, it looked like this: >>> Code: >>> $ip= 8 ; This fix worries me, because that doesn't look like a line the requires quoting (unless you want the spaces to be part of the value). Also, the fact that the unquoted value caused the symptoms it did without any error messages is wrong even if quoting the value fixes it. I'd like to see the entire jail.conf, and see if I can reproduce and pinpoint this problem. - Jamie