From owner-freebsd-questions@freebsd.org Sat Oct 12 23:42:16 2019 Return-Path: Delivered-To: freebsd-questions@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 077F2154256 for ; Sat, 12 Oct 2019 23:42:16 +0000 (UTC) (envelope-from mafsys1234@gmail.com) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46rLvp4tn9z3Kb6 for ; Sat, 12 Oct 2019 23:42:14 +0000 (UTC) (envelope-from mafsys1234@gmail.com) Received: by mail-pg1-x535.google.com with SMTP id i76so7911670pgc.0 for ; Sat, 12 Oct 2019 16:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=v1zJOinzwri0wDHrLhOMGEcZxUtu3I0qDn1zqf3F2rc=; b=o9tT+TFciXH29RcHgS22B8Wcs0t7/I1ChTUTA4xxo1XRE1leeMvuoGjNXamd4NTabV aDWpE/D5VU3xAku83/qwFI7uRH5mf6VQTP2Ds4Bvk90ye3pvKn3GnUX/OzmYZ6dhcl+R tDOlVXImiS9G+tkML5oLRLfZdVzpqo/X7G1JRKBXApk8BcGSH6gsuicUoWs/MROmOzRW vjrHvRNO/jLo30n1r8KTOB5qWNNET5m8pVqPqMzgJx0xOWs3dOw4wKN0otzyodY+ek1L NXgmTNj9DJGON8BEcVyg1Otc+29JFPpGIJiI2QcW8E7vs2pKVQgzwn2wRjXVPMGkh7Zx DNaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=v1zJOinzwri0wDHrLhOMGEcZxUtu3I0qDn1zqf3F2rc=; b=EN5YJ8vBWd80hoiKGkBNdRDQaGfN5/ZTJ7kus81HdhoossjflAxIY8sXSmXw8/5hZf uq6Ypwm7soRlEW6XvuEBsy/45LQSkWc9Y4cTC38yjnZo1iJdcjDZAVJOxlpafpskWuuu qJo9l9bqRUvA917YaiG62Xl6BsEncVCnAB5/7XjBnlNq6PAvFHfw04mkwOTjfIjVA9AK 85MkCwQqO3AhJi/7TloDX9VEFdlpXYc/vjIVrtRdcsL66EJflGCbmW3EOYJ+0GK5JC0k 7fslVfRvkVn0gOH+DM/nVz4brWFLV6s7dN2QWGrL6CKgFOJGAw5fn1U80bEHgKF3jQSW t+gA== X-Gm-Message-State: APjAAAXOsaS2Y1zt7kFhEw90TrvvX/UHmJmkNhPBZOjwI9IGMRw9VkUB IRFKweqpHBrBrzYFzO+mOqklhBCp X-Google-Smtp-Source: APXvYqyb/o94gCfWGhY8oGWiM0mg67LwJ8ZNQycgxtKVyFmKO4c9U1dBN7gQGcHcF1ro/dYHCxBUOA== X-Received: by 2002:a63:ce51:: with SMTP id r17mr24288434pgi.16.1570923732925; Sat, 12 Oct 2019 16:42:12 -0700 (PDT) Received: from [192.168.1.10] (C-59-101-161-221.mel.connect.net.au. [59.101.161.221]) by smtp.gmail.com with ESMTPSA id a17sm12438091pfi.178.2019.10.12.16.42.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Oct 2019 16:42:12 -0700 (PDT) Subject: Re: mysql socket disappears when restarting related jail with nullfs mount point To: "Luis P. Mendes" , freebsd-questions@freebsd.org References: <20191010144257.GA14181@leao.home> From: MJ Message-ID: <8ba25d34-68d1-5bf2-5c4c-996eb297b145@gmail.com> Date: Sun, 13 Oct 2019 10:41:57 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191010144257.GA14181@leao.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 46rLvp4tn9z3Kb6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=o9tT+TFc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mafsys1234@gmail.com designates 2607:f8b0:4864:20::535 as permitted sender) smtp.mailfrom=mafsys1234@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmx.com]; RECEIVED_SPAMHAUS_PBL(0.00)[221.161.101.59.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[5.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-9.36), ipnet: 2607:f8b0::/32(-2.51), asn: 15169(-2.12), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2019 23:42:16 -0000 On 11/10/2019 1:42 am, Luis P. Mendes wrote: > I'm running FreeBSD 11.3-RELEASE-p3 on a VPS. > The jail manager is qjail, version 5.4. > > The server has two jails: a database `mariadb` and a web `webjail`. > Access to the database is done only through a unix socket to be null > mounted at the latter jail. > > When started, 'service mysql-server start' on the `mariadb` jail > places the socket at /var/run/mysql/mysql.sock > > When started, the `webjail` should mount that socket in its own > /var/run/mysql directory. > > This is the line of the corresponding > /usr/local/etc/qjail.fstab/webjail file: > /usr/jails/mariadb/var/run/mysql  /usr/jails/webjail/var/run/mysql > nullfs  rw  0  0 > > > What happens is that everytime that the `webjail` is started (the > first time or when restarted), the socket at `mariadb`'s > /var/run/mysql/mysql.sock > is deleted somehow. > Although this happens, the mysqld_safe and mysqld daemons keep > running. If you observe the mysql.sock after starting mariadb, then start and stop webjail, is the mysql.sock(et) still there? The reason I ask is I would expect mysql to complain bitterly about the socket having gone away but as you state it continues to run. Odd. Is there anything in the mysql error log? ('normally' located in the mysql data directory) > If the `mariadb` jail is started after `webjail`, the socket is > correctly mounted at the latter /var/run/mysql directory. > It's almost like the scenario of "create a file in a directory, then mount that directory, file has 'gone'". This is counter-intuitive to nullfs. Bug? Regards, Mark