Bug 202492 - freebsd-update cron should not output "src component not installed, skipped"
Summary: freebsd-update cron should not output "src component not installed, skipped"
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Allan Jude
Depends on:
Reported: 2015-08-19 18:29 UTC by Jason Stames
Modified: 2020-09-19 02:16 UTC (History)
9 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jason Stames 2015-08-19 18:29:38 UTC
The "freebsd-update cron" command in 10.2-RELEASE produces the following output when run if the src component of the OS is not installed.

src component not installed, skipped

This is not desirable when using the cron option because the output causes an email to be generated.

Patch that introduced the issue:
Comment 1 Xin LI freebsd_committer 2015-08-19 18:41:42 UTC

(In reply to Jason from comment #0)
Comment 2 Xin LI freebsd_committer 2015-08-19 18:44:45 UTC
(In reply to Jason from comment #0)

I have done some initial investigation and my first reaction is that this is actually a feature.  The default /etc/freebsd-update.conf says:

Components src world kernel

And, if src/ is not installed, it seems to be reasonable to keep warning you until the either configuration is changed, or src/ gets installed.

However, from a usability point of view, it does seem reasonable that the installer should make the change for the user if they elected not to install system source code.
Comment 3 Jason Unovitch freebsd_committer 2015-08-19 23:38:43 UTC
(In reply to Xin LI from comment #2)
A quick look at things and I see that most of what freebsd-update interactively prints is from the fetch_run() function and this is normally dumped to a file when `freebsd-update cron` runs (line 3315).  It looks like most of the echo statements outside of this are error conditions and followed by an exit 1.  These error conditions we would want an email from cron to let us know our configuration is wrong.  However we don't want cron to email us a routine notice that the src component is not installed.
Comment 4 Allan Jude freebsd_committer 2015-08-29 15:19:30 UTC
Comment 5 aurelien desbrieres 2017-09-29 02:52:35 UTC
This trouble also happen on a:
# freebsd-update install
src component not installed, skipped
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:43:41 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
- Untouched since 2018-01-01.
- Affects Base System OR Documentation


Reset to open status.

I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 7 Mathieu Arnold freebsd_committer 2020-09-14 12:34:10 UTC
Subscribing here, I am somewhat tired of getting hundreds of one line cron mails every night.
Comment 8 Colin Percival freebsd_committer 2020-09-15 05:08:36 UTC
Does https://reviews.freebsd.org/D26432 do what you expect?
Comment 9 Mathieu Arnold freebsd_committer 2020-09-15 10:41:36 UTC
I do not know, does it stop outputting "src component not installed, skipped" when running freebsd-update cron ?
Comment 10 Colin Percival freebsd_committer 2020-09-15 20:00:04 UTC
(In reply to Mathieu Arnold from comment #9)

That message should now only appear in the email which is sent when updates have been downloaded and are ready to be installed.  But it would be good to have some independent confirmation that the code does what I think it does. ;-)
Comment 11 commit-hook freebsd_committer 2020-09-19 02:16:23 UTC
A commit references this bug:

Author: cperciva
Date: Sat Sep 19 02:15:56 UTC 2020
New revision: 365898
URL: https://svnweb.freebsd.org/changeset/base/365898

  Move finalize_components_config from get_params to cmd_*.

  This allows us to redirect its output in cmd_cron, so that the
  "src component not installed, skipped" message will be treated
  the same way as other output from freebsd-update cron: Sent
  in an email to root (or other address specified) if there are
  updates to install, and silenced otherwise.

  PR:		202492
  MFC After:	1 week
  Differential Revision:	https://reviews.freebsd.org/D26432