| Summary: | /etc/rc should create missing "dumpdir". | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Gary W. Swearingen <swear> |
| Component: | conf | Assignee: | Crist J. Clark <cjc> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.5-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Gary W. Swearingen
2002-03-10 06:00:01 UTC
On Sat, Mar 09, 2002 at 09:57:40PM -0800, Gary W. Swearingen wrote: [snip] > A good (?) and simple enhancement would be to have the code in /etc/rc > which checks for a missing "dumpdir" create it after it determines that > it is missing. I don't think that is a good idea (what if $dumpdev was fat fingered someplace is shouldn't be and say, filled up your root filesystem). However, it currently fails silently, which I don't think is good either. How about have rc(8) bitch about it, Index: etc/rc =================================================================== RCS file: /export/freebsd/ncvs/src/etc/rc,v retrieving revision 1.296 diff -u -r1.296 rc --- etc/rc 17 Feb 2002 22:19:14 -0000 1.296 +++ etc/rc 10 Mar 2002 22:02:56 -0000 @@ -554,10 +554,14 @@ ;; esac - if [ -e "${dumpdev}" -a -d "${dumpdir}" ]; then + if [ -e "${dumpdev}" ]; then /sbin/dumpon -v ${dumpdev} - echo -n 'Checking for core dump: ' - /sbin/savecore ${savecore_flags} "${dumpdir}" + if [ -d "${dumpdir}" ]; then + echo -n 'Checking for core dump: ' + /sbin/savecore ${savecore_flags} "${dumpdir}" + else + echo "dumpdir directory does not exist: ${dumpdir}" + fi fi ;; esac -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org "Crist J. Clark" <cjc@FreeBSD.ORG> writes: > I don't think that is a good idea (what if $dumpdev was fat fingered > someplace is shouldn't be and say, filled up your root > filesystem). However, it currently fails silently, which I don't think > is good either. How about have rc(8) bitch about it, Sounds like you speak from experience. I'll not argue with that. We'll need to rely mostly on a good warning in the FAQ and man page(s). Unless you educate me that I've got the PR SOP wrong, I'll write another PR on the docs and leave this PR for your change to "/etc/rc". Your patch looked good, except I'd prefer a stronger notice (of what happened) to the person recovering from this intermittent crash he's been awaiting for several days: echo "NOTICE: Core dump was lost because '${dumpdir}' was not a directory." But I guess he'll figure it out after not finding the dump files, so either message provides a clue that should be good enough to let him know it wasn't the software's fault that the files are missing. On Sun, Mar 10, 2002 at 03:00:19PM -0800, Gary W. Swearingen wrote: > "Crist J. Clark" <cjc@FreeBSD.ORG> writes: > > > I don't think that is a good idea (what if $dumpdev was fat fingered > > someplace is shouldn't be and say, filled up your root > > filesystem). However, it currently fails silently, which I don't think > > is good either. How about have rc(8) bitch about it, > > Sounds like you speak from experience. I'll not argue with that. > > We'll need to rely mostly on a good warning in the FAQ and man page(s). > Unless you educate me that I've got the PR SOP wrong, I'll write another > PR on the docs and leave this PR for your change to "/etc/rc". > > Your patch looked good, except I'd prefer a stronger notice (of what > happened) to the person recovering from this intermittent crash he's > been awaiting for several days: > > echo "NOTICE: Core dump was lost because '${dumpdir}' was not a directory." But we don't know if a dump was lost or not. You'd see the error everytime you booted. I'll word it more strongly, and I think perhaps another check may be in order. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org State Changed From-To: open->analyzed Why have /etc/rc check at all? Let savecore(8) run. It will complain loudly if given a bummer argument and behaves well. But provide a way to not have savecore(8) run when dumpdev is enabled. Committed to -CURRENT. Responsible Changed From-To: freebsd-bugs->cjc I'll handle MFC. State Changed From-To: analyzed->closed MFC'ed to -STABLE. |