Bug 177217 - [patch] rc.d/ddb -- squelch warning when ddb_enable=yes but DDB missing from kernel
Summary: [patch] rc.d/ddb -- squelch warning when ddb_enable=yes but DDB missing from ...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 9.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-03-22 01:20 UTC by Jeremy Chadwick
Modified: 2022-10-17 12:36 UTC (History)
0 users

See Also:


Attachments
file.diff (584 bytes, patch)
2013-03-22 01:20 UTC, Jeremy Chadwick
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Chadwick 2013-03-22 01:20:00 UTC
	If a user has ddb_enable="yes" in rc.conf, but their kernel is
	lacking "options DDB" and friends, then the following message is
	shown during boot:

	/etc/rc.d/ddb: WARNING: failed precmd routine for ddb

	The reason is that returning 1 from inside of precmd causes rc.subr
	to emit the above warning.  Returning 0 would cause rc.subr to
	continue on and try to run /sbin/ddb, which emits even more errors.

	IMO, the simplest way to solve this dillema is to use "exit 1" and
	bail out of the rc.d script ASAP; some other rc.d scripts use this
	method as well.

	To make this fact clearer to future committers/readers, I added
	an explanation comment.  I also added use of $SYSCTL_N to be
	consistent with other scripts.

	I should note I did try getting rid of the precmd stuff and instead
	making a ddb_start() routine + doing the necessary magic, but this
	induces all sorts of edge cases/nuances relating to required_files
	and command_args and some other things.  exit 1 just seems easier.

	If someone has a better/cleaner method, I'm happy to test such.

Fix: Patch is below, and will be available at the following URL one I
	get a PR number:

	http://jdc.koitsu.org/freebsd/{prnum}/

	Verified as working on stable/9 (r248403).

How-To-Repeat: 	1. Set ddb_enable="yes" in rc.conf on a system lacking DDB support
	in the kernel

	2. Run "/etc/rc.d/ddb start"
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-03-22 21:55:22 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:55 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:58 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>