Subject: Re: run ddb(4) in "batch mode"
To: None <firstname.lastname@example.org>
From: Jukka Salmi <email@example.com>
Date: 03/28/2007 15:52:52
One sentence seems to have disappeared somehow :-P
Jukka Salmi --> current-users (2007-03-28 15:45:02 +0200):
> on a semi-production system I wanted to run some ddb commands in case
> of kernel panics while still achieving best possible uptime, i.e.
> without having to intervene manually to get the system up and running
> again. I set
> ddb.commandonenter='trace; [...]; reboot 0x4'
> and configured the system notice me in case of an unclean shutdown.
> This didn't really work as expected because the ddb.commandonenter
> commands caused ddb to print more than ddb.lines (24) lines of output;
> thus ddb waited for user input to print the next page of output, and
> didn't execute the `reboot' command automatically...
> To fix this problem I added a new variable `batchmode', accessible via
> sysctl(3) as the other built-in ddb variables.
If set, ddb doesn't prompt for user input after 24 (or whatever
ddb.lines is set to) lines were output.
> The resulting patch
> against netbsd-4 is attached.
> Comments are welcome. Please tell in case this is of use for anybody
> else, and I'll send a PR.
$ ((RANDOM%6)) || rm -rf ~