Re: syspatch on diskless fails (stat -qf %Sd / issue)
On Wed, May 03, 2017 at 07:37:11PM +0200, Andreas Kusalananda Kähäri wrote: > On Wed, May 03, 2017 at 11:54:13AM +0200, Antoine Jacoutot wrote: > > On Wed, May 03, 2017 at 11:39:48AM +0200, Andreas Kusalananda Kähäri wrote: > > > Hi, > > > > > > syspatch seems to work fine for keeping my ordinary server and router on > > > -stable, thanks! > > > > > > However, on my diskless workstation it doesn't work so well: > > > > > > Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 > > > 00:00 > > > Installing patch 001_dhcpd > > > /usr/sbin/syspatch: ??=1147776: not found > > > > The error message could be improved but syspatch does the right thing here. > > It properly aborts because it's not designed to work on a diskless system. > > > [cut] > > > How may I apply the binary patch on the diskless system, alternatively, > > > how do I apply it to the diskless system's files on its file server? > > Ok, so that is fine. > > I then tried to run syspatch in a chroot on the diskless client's > fileserver, which is a complete 6.1-release installation. > > This resulted in syspatch exiting without an error, but also without > doing anything. > > After a bit of investigation, I found that it was becasuse the unpriv > shell function generated an error upon invoking su: > > su: approval failure: Undefined error: 0 It turned out this was because of not properly re-mounting the partition with the "suid" mount option. Kudos to Antoine Jacoutot for spending time to reproduce this and getting back to me. Sorry for my confusion about this, I should have spotted my mistake. All sorted now. Regards, Kusalananda
Re: syspatch on diskless fails (stat -qf %Sd / issue)
On Wed, May 03, 2017 at 03:47:00PM -0400, Ted Unangst wrote: > Andreas KusalanandaKähäri wrote: > > I'll try copying from an existing installation, and if that proves to be > > too problematic, I guess I just have to check out the OPENBSD_6_1 branch > > and build a new release (which I really had hoped I would not have to > > do). > > There's nothing magic about the "patch" files, they're just a tgz with updated > files in them. The syspatch command does some nice things like saving old > files for rollback, and downloading and verifying the contents, but if you > look in http://ftp.openbsd.org/pub/OpenBSD/syspatch/6.1/amd64/ it shouldn't be > too hard to work out your own procedure. You're on your own, but it may be > easier than building src from scratch. > This is much appreciated. I will take responsibility for my own mistakes and I will easily recover if I screw up. Thanks Ted!
Re: syspatch on diskless fails (stat -qf %Sd / issue)
Andreas KusalanandaKähäri wrote: > I'll try copying from an existing installation, and if that proves to be > too problematic, I guess I just have to check out the OPENBSD_6_1 branch > and build a new release (which I really had hoped I would not have to > do). There's nothing magic about the "patch" files, they're just a tgz with updated files in them. The syspatch command does some nice things like saving old files for rollback, and downloading and verifying the contents, but if you look in http://ftp.openbsd.org/pub/OpenBSD/syspatch/6.1/amd64/ it shouldn't be too hard to work out your own procedure. You're on your own, but it may be easier than building src from scratch.
Re: syspatch on diskless fails (stat -qf %Sd / issue)
On Wed, May 03, 2017 at 11:41:27AM -0600, Theo de Raadt wrote: > > After a bit of investigation, I found that it was becasuse the unpriv > > shell function generated an error upon invoking su: > > > > su: approval failure: Undefined error: 0 > > > > Is there no way to run syspatch in a chroot either? > > No. > > And that's just plain crazy. > Ok, that's fine too. Now when I know that (also) is not a supported way to keep a diskless client on -stable, I will have to find another way. I'll try copying from an existing installation, and if that proves to be too problematic, I guess I just have to check out the OPENBSD_6_1 branch and build a new release (which I really had hoped I would not have to do). This is no criticism, I'm just happy that the use cases for syspatch are sorted out. I'll sort my diskless machines out eventually. Thanks, Kusalananda
Re: syspatch on diskless fails (stat -qf %Sd / issue)
> After a bit of investigation, I found that it was becasuse the unpriv > shell function generated an error upon invoking su: > > su: approval failure: Undefined error: 0 > > Is there no way to run syspatch in a chroot either? No. And that's just plain crazy.
Re: syspatch on diskless fails (stat -qf %Sd / issue)
On Wed, May 03, 2017 at 11:54:13AM +0200, Antoine Jacoutot wrote: > On Wed, May 03, 2017 at 11:39:48AM +0200, Andreas Kusalananda Kähäri wrote: > > Hi, > > > > syspatch seems to work fine for keeping my ordinary server and router on > > -stable, thanks! > > > > However, on my diskless workstation it doesn't work so well: > > > > Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 > > 00:00 > > Installing patch 001_dhcpd > > /usr/sbin/syspatch: ??=1147776: not found > > The error message could be improved but syspatch does the right thing here. > It properly aborts because it's not designed to work on a diskless system. > [cut] > > How may I apply the binary patch on the diskless system, alternatively, > > how do I apply it to the diskless system's files on its file server? Ok, so that is fine. I then tried to run syspatch in a chroot on the diskless client's fileserver, which is a complete 6.1-release installation. This resulted in syspatch exiting without an error, but also without doing anything. After a bit of investigation, I found that it was becasuse the unpriv shell function generated an error upon invoking su: su: approval failure: Undefined error: 0 Is there no way to run syspatch in a chroot either? Regards, Kusalananda
Re: syspatch on diskless fails (stat -qf %Sd / issue)
On Wed, May 03, 2017 at 11:39:48AM +0200, Andreas Kusalananda Kähäri wrote: > Hi, > > syspatch seems to work fine for keeping my ordinary server and router on > -stable, thanks! > > However, on my diskless workstation it doesn't work so well: > > Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 00:00 > Installing patch 001_dhcpd > /usr/sbin/syspatch: ??=1147776: not found The error message could be improved but syspatch does the right thing here. It properly aborts because it's not designed to work on a diskless system. > This is due to stat returning "??" when asking for the device that holds > the root (?) filesystem in the checkfs shell function. This is with > "set -x" at the start of that function: > > Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 00:00 > Installing patch 001_dhcpd > + typeset _d _df _dev _files=./usr/sbin/dhcpd > ./usr/share/man/man5/dhcpd.conf.5 > ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig _sz > + echo ./usr/sbin/dhcpd ./usr/share/man/man5/dhcpd.conf.5 > ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig > + grep -qw bsd > + cd / > + stat -qf _dev="${_dev} %Sd" %Sd="${%Sd:+${%Sd}\+}%Uz" ./usr/sbin/dhcpd > ./usr/share/man/man5/dhcpd.conf.5 > ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig > + eval _dev="${_dev} ??" ??="${??:+${??}\+}147776" _dev="${_dev} ??" > ??="${??:+${??}\+}29070" > + ??=1147776 _dev= ?? ??=129070 > + _dev= ?? > /usr/sbin/syspatch: ??=1147776: not found > + set +e > + rm -rf /tmp/syspatch.vlGsTTUac6 > > > How may I apply the binary patch on the diskless system, alternatively, > how do I apply it to the diskless system's files on its file server? > > Regards, > Kusalananda > -- Antoine
syspatch on diskless fails (stat -qf %Sd / issue)
Hi, syspatch seems to work fine for keeping my ordinary server and router on -stable, thanks! However, on my diskless workstation it doesn't work so well: Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 00:00 Installing patch 001_dhcpd /usr/sbin/syspatch: ??=1147776: not found This is due to stat returning "??" when asking for the device that holds the root (?) filesystem in the checkfs shell function. This is with "set -x" at the start of that function: Get/Verify syspatch61-001_dhcpd.tgz 100% |*| 71733 00:00 Installing patch 001_dhcpd + typeset _d _df _dev _files=./usr/sbin/dhcpd ./usr/share/man/man5/dhcpd.conf.5 ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig _sz + echo ./usr/sbin/dhcpd ./usr/share/man/man5/dhcpd.conf.5 ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig + grep -qw bsd + cd / + stat -qf _dev="${_dev} %Sd" %Sd="${%Sd:+${%Sd}\+}%Uz" ./usr/sbin/dhcpd ./usr/share/man/man5/dhcpd.conf.5 ./var/syspatch/61-001_dhcpd/001_dhcpd.patch.sig + eval _dev="${_dev} ??" ??="${??:+${??}\+}147776" _dev="${_dev} ??" ??="${??:+${??}\+}29070" + ??=1147776 _dev= ?? ??=129070 + _dev= ?? /usr/sbin/syspatch: ??=1147776: not found + set +e + rm -rf /tmp/syspatch.vlGsTTUac6 How may I apply the binary patch on the diskless system, alternatively, how do I apply it to the diskless system's files on its file server? Regards, Kusalananda