Date: Thu, 8 Jun 2017 03:53:18 +0300 From: Arto Pekkanen <isoa@kapsi.fi> To: freebsd-pkg@freebsd.org Subject: Re: pkg rollback Message-ID: <a4b73481-ac0b-faa3-7187-30dc05c19888@kapsi.fi> In-Reply-To: <CAB88xy_%2BTC4ErxY9UVSkoLH1eeiWNO7Ho%2B_848b09Z_GmDTU-A@mail.gmail.com> References: <CAB88xy_%2BTC4ErxY9UVSkoLH1eeiWNO7Ho%2B_848b09Z_GmDTU-A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DOu5U8Set5d3w8wiurfCTmmJ9i7J0vjtH Content-Type: multipart/mixed; boundary="gFgSloURdD92owwCbcDwrjK9q8uBsEeXW"; protected-headers="v1" From: Arto Pekkanen <isoa@kapsi.fi> To: freebsd-pkg@freebsd.org Message-ID: <a4b73481-ac0b-faa3-7187-30dc05c19888@kapsi.fi> Subject: Re: pkg rollback References: <CAB88xy_+TC4ErxY9UVSkoLH1eeiWNO7Ho+_848b09Z_GmDTU-A@mail.gmail.com> In-Reply-To: <CAB88xy_+TC4ErxY9UVSkoLH1eeiWNO7Ho+_848b09Z_GmDTU-A@mail.gmail.com> --gFgSloURdD92owwCbcDwrjK9q8uBsEeXW Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Why does not ZFS snapshot and rollback work for this scenario? On 7.6.2017 16:40, Luca Pizzamiglio wrote: > Hi all, >=20 > I'm trying to figure out how an automatic process to upgrade packages > on production machines can look like. >=20 > A kind of: > # pkg upgrade > # restart services > # if everything not OK > # rollback > # restart services >=20 > I'm considering a package repository that is not guaranteeing 100% > stability, like `latest`. > Even intercepting events needing manual intervention (i.e. reported by > UPDATING), a blind pkg upgrade can break the web application running > on top. > So, I was thinking if it's possible to perform some kind of rollback. >=20 > to proof if it's possible, I wrote a shell scripts with two features > (it helped me a lot to understand how pkg works): > # backup > ## backup the repo sqlite database > ## run `pkg update` and determine all actions would be performed by > `pkg upgrade` (a kind of `pkg upgrade` simulation) > ## backup all packages from the cache that would be replaced by `pkg up= grade` > ## download all new packages to determine potentially conflicts > ## backup all packages from the cache that would be replaced by `pkg > upgrade` (after determined conflicts) > ## restore the repo sqlite database > # rollback > ## restore the repo sqlite database > ## install all previously backup'ed packages >=20 > Another approach, less complex, but I guess even valid, could be: > # backup (or snapshot) > ## backup of the repo sqlite database > ## take a snapshot of all installed packages > # rollback (a previously stored snapshot) > ## restore the repo sqlite database > ## reinstall all previously backup'ed packages >=20 > Adding two features [snapshot and rollback] to pkg(8), the automated > upgrade process would become: > # pkg snapshot > # pkg upgrade > # restart services > # if everything not OK > # rollback > # restart services >=20 > What do you think? > What am I missing? > Ideas, suggestions and feedback are welcome, so, please, feel free to r= eply. >=20 > Best regards, > Luca >=20 > PS: I'd use `pkg snapshot`, because `pkg backup` already exist and it > has another meaning. > PS2: In some case, `zfs snapshot` could work as well, but it's not > always possible > PS3: if feebacks are positive, I'd like to implement those features > _______________________________________________ > 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" >=20 --=20 Arto Pekkanen --gFgSloURdD92owwCbcDwrjK9q8uBsEeXW-- --DOu5U8Set5d3w8wiurfCTmmJ9i7J0vjtH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlk4oAkACgkQTBivhqtJa26pUQD/WU63lDyYeSXLu/y0kgJ7duqO n9jqCsc7vYuLnWNdgAAA/0xQwqRXUUxbCE0f82Cqr1TsUIAZWs88GsxZlQ0Ez1vm =Fqx+ -----END PGP SIGNATURE----- --DOu5U8Set5d3w8wiurfCTmmJ9i7J0vjtH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a4b73481-ac0b-faa3-7187-30dc05c19888>