On 2021/08/27 23:07, Aaron Poffenberger wrote:
> On 2021-08-27 23:00 -0400, Daniel Jakots <d...@chown.me> wrote:
> > On Fri, 27 Aug 2021 20:17:51 -0500, Aaron Poffenberger
> > <a...@hypernote.com> wrote:
> > 
> > > + ${PKGS} && echo "pkg_add -Iu" >> /etc/rc.firsttime
> > 
> > I don't think this addition is worth it, but anyway this won't work for

I do - I do this a lot manually and it's a pain to start sysupgrade
downloading with -n, wait for it to finish, then edit the file so
would welcome a flag to do it.

I find the method helpful as it means you don't run outdated packages
after reboot (which might even crash after some updates) and don't need
to reboot 3 times (to bsd.rd for sysupgrade, then to the new kernel,
then again to restart package daemons etc) which takes flipping ages on
some servers.

It's not perfect because some packages ask questions if pkg_adf is
run in interactive mode (mostly just postgresql across major version
updates). Aaron's diff uses -I to disable that which stops those
packages from getting updated when the trigger condition applies,
but that's not very common in the ports tree and doesn't make it
less useful.

The point at which rc.firsttime runs is after sshd starts, so if the
package update does run into any problems you can still connect in
to fix, and progress can be seen in "dmesg -s" or syslog.

> > people running -current when it's release time and the release isn't
> > available yet (-Dsnap).

sysupgrade itself doesn't work properly in that case either, you need
tricks to get from "not quite release but the -beta suffix was removed"
to actual release. I think there might be other problems with the
system relating to version handling in that time too. Basically we just
need to keep that to the smallest possible time window.

> Initially I considered a PKG_ADD environment variable to let the
> override the command concatenated to /etc/rc.firsttime, but held
> off until needed. Something like the following would resolve that
> concern.
> 
> PKG_ADD='pkg_add -Iu -Dsnap' sysupgrade -u

No need for that complexity, just set a variable to -Dsnap if sysupgrade
-s was used and include it on the line that adds pkg_add to the file.

Bikeshed: I think I'd prefer using a -p flag to signify packages rather
than -u.

Reply via email to