NetBSD — Unix — multimedia — other fun

Random NetBSD sysctl tricks!

— Saturday, August 03, 2013

There's hardly a message or overarching moral to this entry. I simply thought this information was interesting...

uptime(1) tells you how long the system has been up, but you can also discover at what time the machine was started:

$ sysctl kern.boottime

Get nothing but load averages:

$ sysctl -n vm.loadavg

By default, NetBSD does not forward network packets, you have to turn it on yourself:

# sysctl -w net.inet.ip.forwarding=1

And if you use IPv6:

# sysctl -w net.inet6.ip6.forwarding=1

I've never had a need for this, but it appears you can adjust almost anything you want about NetBSD's in-kernel debugger:

$ sysctl -a | grep ^ddb
ddb.radix = 16
ddb.maxoff = 1048576
ddb.maxwidth = 80
ddb.lines = 24
ddb.tabstops = 8
ddb.onpanic = 0
ddb.fromconsole = 1
ddb.tee_msgbuf = 0
ddb.commandonenter = 

If you've enabled Linux emulation, you can see which version you're running:

$ sysctl -a | grep emul.linux.kern
emul.linux.kern.ostype = Linux
emul.linux.kern.osrelease = 2.6.18
emul.linux.kern.osversion = #0 Wed Mar 3 03:03:03 PST 2010

Oh yeah, don't forget to use sysctl -d if you don't understand what a particular field means! I really wish audioctl and mixerctl had similar functionality.

Post a Comment