From owner-freebsd-pkg@FreeBSD.ORG Thu Oct 3 09:13:23 2013 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9E0DE55B for ; Thu, 3 Oct 2013 09:13:23 +0000 (UTC) (envelope-from bw.mail.lists@gmail.com) Received: from mail-ea0-x22c.google.com (mail-ea0-x22c.google.com [IPv6:2a00:1450:4013:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 393722F95 for ; Thu, 3 Oct 2013 09:13:23 +0000 (UTC) Received: by mail-ea0-f172.google.com with SMTP id r16so951015ead.17 for ; Thu, 03 Oct 2013 02:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=G6WWF5bnI91yRyBEEAkRD7a/G2a2x96iXwQpFjB+4iY=; b=J8M7scIr1+fJD0J8PfrVXJDJKQiJfpFwylbrobBRkn9A0P69uB0Ys4mvDgPP0hIC16 /xCK0Hk8waaABJ+OXAjTKdYTb1yB+UcDFrzQSbhZBvD2b96lG9Kbz0/+cLScHIaDK0Il RHjZsS97prd7Im+YjHTItZ83HnAdM9qezO2vJCnrLaYSHuSrTNuqMvU7v7zIb5rZm7ev 7n7MkgNGiKFY2mvU7ri5PQHxM5aXnkHIOtvXwbun4O8Nl5Zoc+/t8yeu93760u8Qwbt7 T2HGZj7kLEdqNlsELVD4isGlBwuOkE/YRdhIvVfPohhVqNg3ux5InMKtHWZ/VHe6n5AL eEAw== X-Received: by 10.14.241.141 with SMTP id g13mr1358925eer.75.1380791601692; Thu, 03 Oct 2013 02:13:21 -0700 (PDT) Received: from [172.28.23.192] ([87.213.55.5]) by mx.google.com with ESMTPSA id j7sm13319488eeo.15.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:13:20 -0700 (PDT) Message-ID: <524D3525.4000201@gmail.com> Date: Thu, 03 Oct 2013 11:13:09 +0200 From: "bw.mail.lists" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-pkg@freebsd.org Subject: pkgng install/upgrade and puppet or similar Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Oct 2013 09:13:23 -0000 The fact that pkg first upgrades itself then exits successfully when trying to install a package is unexpected behavior and can trip quite a few things. Case in point. I have a manifest that installs postfix, stops sendmail, then installs mailer.conf and main.cf in /usr/local/etc/postfix. Quite standard stuff. However, if there is an upgrade to pkg what will happen is puppet will run 'pkg install -y postfix' which will in fact upgrade pkg and exit successfully, while postfix is not actually installed. Next the manifest will stop sendmail and change mailer.conf to point to postfix, because it thinks it was installed successfully, then try to install main.cf in a nonexistent directory, which fails. This leaves the system with no MTA running, since sendmail was stopped but postfix was not installed. Obviously not good, even if postfix will (probably!) get installed the next time puppet runs. I see two obvious choices, either - exit with an error if pkg didn't execute what was actually requested, because I asked for postfix to be installed, not pkg to be upgraded or - let pkg upgrade itself then execute what was actually requested and return the error code of the second operation, assuming it got to it. If pkg insists on upgrading itself IMHO this would be the better way. I hope I didn't miss it, but I didn't see any argument that can be passed to pkg to make it ignore the upgrade in the man page. From owner-freebsd-pkg@FreeBSD.ORG Thu Oct 3 09:26:45 2013 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9171EFE for ; Thu, 3 Oct 2013 09:26:45 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADCDF20BB for ; Thu, 3 Oct 2013 09:26:45 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id i11so1493495qej.39 for ; Thu, 03 Oct 2013 02:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5PzI9gGIHjsWUIyAbja4MMqOOE+ocS8AhvDA4c0EHmU=; b=livr0WUOpi/tge5mIRyeihsYS0QzSr0JsZpSke6QImNEQwJPVXsDiFN4gEbdsZ6Ad0 Pr8PMi83vBNbjwAFr/UMvbFNHqKsnmPnJRKCV1ZKptyKnpgsFmq8yMZIFCx/dWBLcuWS 5qRwX02afvOc1m9FB0XdrLNQ1E3fbAZZpFGO5QA1rLZZdqYu0OG/DTKiroeUBK1nAF5V MJnyxSMrNomxpammXpFVJLhxt4T+mt5KbzFlry/o2X1AU6+Uhs4vJtCKgBIjfnBNOqlm EenIt0UUfsDp6OY11FtRkxVB8S0hQIhikzhmvTuHIEXtrEI77le4Jo/ZnTWzBABz+Wno 40CA== MIME-Version: 1.0 X-Received: by 10.229.116.197 with SMTP id n5mr8131303qcq.22.1380792404428; Thu, 03 Oct 2013 02:26:44 -0700 (PDT) Received: by 10.224.88.197 with HTTP; Thu, 3 Oct 2013 02:26:44 -0700 (PDT) In-Reply-To: <524D3525.4000201@gmail.com> References: <524D3525.4000201@gmail.com> Date: Thu, 3 Oct 2013 12:26:44 +0300 Message-ID: Subject: Re: pkgng install/upgrade and puppet or similar From: Kimmo Paasiala To: "bw.mail.lists" Content-Type: text/plain; charset=UTF-8 Cc: freebsd-pkg@freebsd.org X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Oct 2013 09:26:46 -0000 On Thu, Oct 3, 2013 at 12:13 PM, bw.mail.lists wrote: > The fact that pkg first upgrades itself then exits successfully when trying > to install a package is unexpected behavior and can trip quite a few things. > > Case in point. > > I have a manifest that installs postfix, stops sendmail, then installs > mailer.conf and main.cf in /usr/local/etc/postfix. Quite standard stuff. > However, if there is an upgrade to pkg what will happen is puppet will run > 'pkg install -y postfix' which will in fact upgrade pkg and exit > successfully, while postfix is not actually installed. Next the manifest > will stop sendmail and change mailer.conf to point to postfix, because it > thinks it was installed successfully, then try to install main.cf in a > nonexistent directory, which fails. This leaves the system with no MTA > running, since sendmail was stopped but postfix was not installed. Obviously > not good, even if postfix will (probably!) get installed the next time > puppet runs. > > I see two obvious choices, either > - exit with an error if pkg didn't execute what was actually requested, > because I asked for postfix to be installed, not pkg to be upgraded > or > - let pkg upgrade itself then execute what was actually requested and return > the error code of the second operation, assuming it got to it. If pkg > insists on upgrading itself IMHO this would be the better way. > > I hope I didn't miss it, but I didn't see any argument that can be passed to > pkg to make it ignore the upgrade in the man page. > _______________________________________________ How about a new subcommand 'pkg selfupgrade'? This would be the only way to upgrade pkg itself, the 'pkg upgrade' would then notify the user to use 'pkg selfupgrade' in case pkg was out of date but wouldn't actually perform the upgrade. -Kimmo From owner-freebsd-pkg@FreeBSD.ORG Thu Oct 3 15:30:39 2013 Return-Path: Delivered-To: freebsd-pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25344584 for ; Thu, 3 Oct 2013 15:30:39 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF1A12BD9 for ; Thu, 3 Oct 2013 15:30:38 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=shatow.net; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=sweb; b=Aps+b2K43uuAeoxQat+jeUtlHXj5wzGK/ JH0FxqP11CKDDGeTnmCPOBoum9KxOUS++q5izWMqRApRAcKOSuqheIGT7yLrW//I nSvUv7ISVhVDfxfcqjgxFc7iouIFceIpOQGV4cbce7WjLmH0LYYDcv5NDYRmy/ty baEvyooNu0= DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=shatow.net; h=date:from :to:cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=sweb; bh=HxKnW8aLPc7+ATkMpCPrIdO2/2phJ26YFDhqSG8 NGSk=; b=Awmoh0rsd7/dTZ//S48USpxKFbRdWIY7HSkxqILbt8oU8CiHAyMq5jk Ys9LK6MgUYYY8dPpZbqimTb8J3FmtWMxM5O+2cgcIjIG3vflQQEzmrf+Jy/cjped 0BVw9y+jTJmpuWINBtUQWtvgFIsPeUwQnS9ie/8OU2ngNoVm64Ic= Received: (qmail 8581 invoked from network); 3 Oct 2013 10:30:31 -0500 Received: from unknown (HELO admin.xzibition.com) (bryan@shatow.net@173.160.118.90) by sweb.xzibition.com with ESMTPA; 3 Oct 2013 10:30:31 -0500 Date: Thu, 3 Oct 2013 10:30:27 -0500 From: Bryan Drewery To: "bw.mail.lists" Subject: Re: pkgng install/upgrade and puppet or similar Message-ID: <20131003153027.GA98118@admin.xzibition.com> References: <524D3525.4000201@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <524D3525.4000201@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-pkg@freebsd.org X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Oct 2013 15:30:39 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 03, 2013 at 11:13:09AM +0200, bw.mail.lists wrote: > The fact that pkg first upgrades itself then exits successfully when=20 > trying to install a package is unexpected behavior and can trip quite a= =20 > few things. >=20 > Case in point. >=20 > I have a manifest that installs postfix, stops sendmail, then installs=20 > mailer.conf and main.cf in /usr/local/etc/postfix. Quite standard stuff.= =20 > However, if there is an upgrade to pkg what will happen is puppet will=20 > run 'pkg install -y postfix' which will in fact upgrade pkg and exit=20 > successfully, while postfix is not actually installed. Next the manifest= =20 > will stop sendmail and change mailer.conf to point to postfix, because=20 > it thinks it was installed successfully, then try to install main.cf in= =20 > a nonexistent directory, which fails. This leaves the system with no MTA= =20 > running, since sendmail was stopped but postfix was not installed.=20 > Obviously not good, even if postfix will (probably!) get installed the=20 > next time puppet runs. >=20 > I see two obvious choices, either > - exit with an error if pkg didn't execute what was actually requested,= =20 > because I asked for postfix to be installed, not pkg to be upgraded > or > - let pkg upgrade itself then execute what was actually requested and=20 This one is coming in 1.2.0. pkg will re-execute the original command after upgrade now. > return the error code of the second operation, assuming it got to it. If= =20 > pkg insists on upgrading itself IMHO this would be the better way. >=20 > I hope I didn't miss it, but I didn't see any argument that can be=20 > passed to pkg to make it ignore the upgrade in the man page. > _______________________________________________ > freebsd-pkg@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-pkg > To unsubscribe, send any mail to "freebsd-pkg-unsubscribe@freebsd.org" --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQJ8BAEBCgBmBQJSTY2RXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzNkZFQkU5OTJGNTI4MERGNDgxMTM2MkE2 RTc4MkFDMDNDOUIwQ0Y5AAoJEG54KsA8mwz5cBEP/04I4XKC9qhvwP/OVIbT2V5Q M3Emcn/Q97Je+uBachWIxb8Qb876rGoZYD1e69ZeBYgVz0TMps2G5GUX5+7QDmI9 zuelxxLvCznJ3AlTvWlQIa3D9S1uX/ppqdPUog6JXyThOMoVhkU1UzSAvwo6P4oB 8pu1BgeF91i0BNQ7AT/moPaIxBKINnfQVLF32fSF0y09M6qUiLS7WI9AGn2V+x05 0H2bnbBsSoBDPkNcsMMjdG3lPSoUd3gbMARjaBZUQuhorC6Ncg8hM9pr2slbCBaX Rwon0qv8ta9B4ODy7iTka/t+p5YwIWpI2xEeCbO895YYey3y+sdKYgESQUqvnUDk RdfkXaeOeqdwT2rWltvrLZGLUNiapx5gzvWhqCwktzeFMh0HMfqKORp1svvUVIke 3MvT0jH1owqt2dHoFI/tfIe0CKOCT9n2Vnswc0YNRSkQn+Xa4IPz/d7d1vPrH2b5 cEB9hDxuqxwpWctK4ctbdPkzOilSCTkGjeNDK3RgSbeCgfotHzjXCxuzCwqQauok JcoxrR0xXAaEQC7PsJ1uspS+h+Q+vASfYdqbYulC+GaCFWIZnzoEddgafpZCilJH I3qM52wcRdZiWJm4NiIBCkaUuCWFG4/JJODv6SGhc+wDSZk261gGh0EpQyDrq6lr 6gP/hVQOC30LM2K/ZMgC =0cwz -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv--