From owner-freebsd-questions@FreeBSD.ORG Thu Jun 9 09:12:33 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFF8F16A41C for ; Thu, 9 Jun 2005 09:12:33 +0000 (GMT) (envelope-from vdaelli@hotmail.com) Received: from hotmail.com (bay103-f8.bay103.hotmail.com [65.54.174.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id A874143D1D for ; Thu, 9 Jun 2005 09:12:33 +0000 (GMT) (envelope-from vdaelli@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 9 Jun 2005 02:12:33 -0700 Message-ID: Received: from 65.54.174.210 by by103fd.bay103.hotmail.msn.com with HTTP; Thu, 09 Jun 2005 09:12:32 GMT X-Originating-IP: [65.54.174.210] X-Originating-Email: [vdaelli@hotmail.com] X-Sender: vdaelli@hotmail.com In-Reply-To: <20050609082759.GA1851@gicco.homeip.net> From: "Valerio Daelli" To: freebsd-questions@freebsd.org Date: Thu, 09 Jun 2005 09:12:32 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 09 Jun 2005 09:12:33.0249 (UTC) FILETIME=[5EB11510:01C56CD3] Subject: Jails on NFS: locks on file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2005 09:12:33 -0000 Hi all, we are using FreeBSD 5.4 with some jails. One of this jail is on a NFS directory - I mean: the whole filesystem of this jail is on a remote directory, exported by a FreeBSD 5.4 server with NFS, and the 'host' system (the one that started and stopped the jail) mounts it via NFS. In this jail we can't perform a 'flock' operation, even if the NFS server has rpc.lockd and rpc.statd. We built a little executable in C like this (let's call it myflock): ___________________________________________________________ #include #include #include int main() { int lockfd; char* tempfile="tempfile"; lockfd=open(tempfile,O_CREAT); if (flock(lockfd, LOCK_SH|LOCK_NB)==-1) { printf("ERROR shared lock: %d",errno); } if (flock(lockfd, LOCK_EX|LOCK_NB)==-1) { printf("ERROR exclusive lock: %d",errno); } close(lockfd); } ___________________________________________________________ We executed on a local directory and it gets the flock. We executed on the mounted NFS partition (with rpc.lockd and rpc.statd) and it works. We executed in the jail-NFS and it fails! Errno 45 (from '/usr/include/errno.h': #define EOPNOTSUPP 45 /* Operation not supported */). The directory where we launch myflock is the same as the previous command (no permission problems). We executed in a jail contained in a md mounted on a NFS directory and it works. Could it be a rpcbind issue (the jail can't get the flock since it can't rpc-contact the NFS server)? Thanks a lot Valerio Daelli