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"
Responsible Changed From-To: freebsd-bugs->freebsd-rc Over to maintainer(s).
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
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>