diff options
author | Mike Silbersack <silby@FreeBSD.org> | 2003-10-21 16:49:30 +0000 |
---|---|---|
committer | Mike Silbersack <silby@FreeBSD.org> | 2003-10-21 16:49:30 +0000 |
commit | 9b4b73b7bac633ce64b5012ff6f3773e40d8aff2 (patch) | |
tree | 1c1dab02ffd8c46af861f395ed8d97617e200572 /sbin/sysctl | |
parent | bd6fb64bb3b9f178e5d707daa2119f98c952f04d (diff) | |
download | src-9b4b73b7bac633ce64b5012ff6f3773e40d8aff2.tar.gz src-9b4b73b7bac633ce64b5012ff6f3773e40d8aff2.zip |
Have sysctl print out a more useful error message when it detects that the
user has attempted to write to a read only, tunable value.
Notes
Notes:
svn path=/head/; revision=121306
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 787a489edeb9..451548ff3f89 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -197,7 +197,12 @@ parse(char *string) errx(1, "oid '%s' isn't a leaf node", bufp); if (!(kind&CTLFLAG_WR)) - errx(1, "oid '%s' is read only", bufp); + if (kind & CTLFLAG_TUN) { + fprintf(stderr, "Tunable values are set in /boot/loader.conf and require a reboot to take effect.\n"); + errx(1, "oid '%s' is a tunable.", bufp); + } else { + errx(1, "oid '%s' is read only", bufp); + } if ((kind & CTLTYPE) == CTLTYPE_INT || (kind & CTLTYPE) == CTLTYPE_UINT || |