From owner-freebsd-pkg@freebsd.org Wed Oct 19 13:16:51 2016 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE8A6C17CE4 for ; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D8768907 for ; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id D7D31C17CE3; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) Delivered-To: pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D777FC17CE2 for ; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD20905 for ; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JDGp8j001889 for ; Wed, 19 Oct 2016 13:16:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: maintainer-feedback requested: [Bug 213611] ports-mgmt/pkg: 1.9.1 pkgdb locking doesn't work on NFS Date: Wed, 19 Oct 2016 13:16:51 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 13:16:52 -0000 Markus Wennrich has reassigned Bugzilla Automation 's request for maintainer-feedback to pkg@FreeBSD.org: Bug 213611: ports-mgmt/pkg: 1.9.1 pkgdb locking doesn't work on NFS https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213611 --- Description --- pkg info fails with following error, if /var/db/pkg is on NFS: pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1033: database is locked ktrace: 61912 pkg CALL setgroups(0x1,0x802780abc) 61912 pkg RET setgroups 0 61912 pkg CALL setegid(0xfffe) 61912 pkg RET setegid 0 61912 pkg CALL setgid(0xfffe) 61912 pkg RET setgid 0 61912 pkg CALL seteuid(0xfffe) 61912 pkg RET seteuid 0 61912 pkg CALL setuid(0xfffe) 61912 pkg RET setuid 0 61912 pkg CALL=20 mkdir(0x80301c2e8,0x1ff) 61912 pkg NAMI "/var/db/pkg/local.sqlite.lock" 61912 pkg RET mkdir -1 errno 13 Permission denied =3D=3D> privileges get dropped and only afterwards mkdir /var/db/pkg/local.sqlite.lock is tried, which has to fail as user "nobody". Verified with "chmod 777 /var/db/pkg/" drwxr-xr-x 2 nobody nobody 4096 Oct 19 12:50 local.sqlite.lock >From src/info.c: 322 323 drop_privileges(); 324 if (pkgdb_obtain_lock(db, PKGDB_LOCK_READONLY) !=3D EPKG_OK) { 325 pkgdb_close(db); Probably wrong order of drop_privileges and pkgdb_obtain_lock? This happens only on NFS because of this in src/pkgdb.c: 1026 /* 1027 * Fall back on unix-dotfile locking strategy if on a network filesys= tem 1028 */ (...) 1034 sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1); (Our quick workaround was to comment out the whole "fall back on unix-dotfi= le on NFS" part. Probably not the best solution ...)