| Summary: | /etc/rc.d/sysctl script works incorrectly in case of non-existent MIB | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Sergey Mokryshev <mokr> | ||||
| Component: | conf | Assignee: | Mike Makonnen <mtm> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 5.0-CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
This appears to be an attempt to preserve /etc/rc.sysctl's original functionality, which was to run twice -- the early run would not complain about illegal sysctl variables, presumably to allow sysctl.conf to contain variables that were in modules that would be loaded later. If one runs "/etc/rc.d/sysctl lastload", you get the right behavior -- however, there doesn't seem to be any provision to ever run "/etc/rc.d/sysctl lastload". I don't know enough about the rc.d system to know how to fix it -- perhaps an /etc/rc.d/sysctllast which runs /etc/rc.d/sysctl lastload? Alternately, if we are going to abandon the multiple sysctl.conf loads, the elif should just be turned into an else, the additional test of $? is not necessary. Bill Responsible Changed From-To: freebsd-bugs->mtm Assign to rcng maintainer State Changed From-To: open->closed Bill is right, the script is supposed to be run twice, and the warning is shown only if called with the last argument. As for the problem of not being called twice in the boot sequence, that's already fixed. |
/sbin/sysctl does not return anything printable upon request (sysctl -n ${mib}) of a non-existent variable, just an error-code. The code in 'elif' clause in /etc/rc.d/sysctl elif [ "$1" -eq "last" ]; then warn "sysctl ${mib} does not exits." fi is probably wrong How-To-Repeat: Put a non-existent variable in /etc/sysctl.conf and reboot. There will be message like (taken from /var/log/console.log) Oct 20 00:22:44 amber kernel: [: : bad number