# About the sysctl.conf



## Luca79 (Jul 20, 2015)

Hello,

I'm new here.
I trying to install FreeBSD i386 on a old machine. After I have done on VirtualBox.

When I try to install the nVidia-304 I have an error. I should increase the kern.ipc.shmall value.
So with a editor I open the /etc/sysctl.conf but there are only comments. Basically empty.
The same in the VirtualBox.

I read the manual about the /etc/sysctl.conf, but seem it should be compiled automatically?
Or I get it wrong?

Thanks


----------



## SirDice (Jul 20, 2015)

The file is mostly empty by default. Just add what you need and `service sysctl restart`.


----------



## freethread (Jul 20, 2015)

Some sysctl variables must be set in /boot/loader.conf and if I'm right, kern.ipc.shmall is one of them.


----------



## tobik@ (Jul 20, 2015)

freethread said:


> f I'm right, kern.ipc.shmall is one of them.


No, kern.ipc.shmall can be set with `sysctl` after boot.


----------



## freethread (Jul 20, 2015)

Ah, ok, then I'm wrong. I remember some kern.ipc.shmXXX go in /boot/loader.conf and others in /etc/sysctl.conf I only have one machine that use them with KDE (as guest in VirtualBox). I set them this way

In /boot/loader.conf

```
kern.ipc.shmmni=1024
kern.ipc.shmseg=1024
```

In /etc/sysctl.conf

```
kern.ipc.shm_allow_removed=1
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
kern.ipc.somaxconn=1024
```

sorry for my previous reply.


----------



## SirDice (Jul 21, 2015)

Not sure which ones, I don't know them from the top of my head. But you are correct, some values have to be set in /boot/loader.conf so they're loaded before the kernel starts (and cannot be changed once the kernel is loaded). Most can be set, on-the-fly, through /etc/sysctl.conf for example.


----------



## tobik@ (Jul 21, 2015)

You can get a list of loader settable sysctls with e.g. `sysctl -dT kern.ipc` and a list of all runtime settable sysctls with `sysctl -dW kern.ipc`.

The kern.ipc.shm* sysctls that can be set after boot are: 
	
	



```
kern.ipc.shm_allow_removed: Enable/Disable attachment to attached segments marked for removal
kern.ipc.shm_use_phys: Enable/Disable locking of shared memory pages in core
kern.ipc.shmall: Maximum number of pages available for shared memory
kern.ipc.shmmin: Minimum shared memory segment size
kern.ipc.shmmax: Maximum shared memory segment size
```
All of these can also be set in the loader. The next ones can only be set in the loader: 
	
	



```
kern.ipc.shmseg: Number of segments per process
kern.ipc.shmmni: Number of shared memory identifiers
```


----------



## Luca79 (Jul 30, 2015)

Thanks for the replies guys.

But seem my old machine is getting too old, and get stuck any time I reinstall the system and try to update it...

When I reboot I have some error and fail to boot...  I think is time to search something of newer


----------

