Packages doing crazy things (sysctls, /boot/loader.conf mods)
So we have packages
1/ messing with /etc/sysctl.conf like:
and even /boot/loader.conf:
This is a completely retarded idea which lingers there even after package uninstall, because noone has bothered with cleaning up after themselves when reading the package.
2/ Then we have packages that mess with sysctls only when running (starting), like:
Doing it in rc script/on package start seems a lot better than #1.
3/ Finally, there's input validation approach a.k.a. let users do with legwork if they need crazy shit:
Personally, I'd say this one is the most safe way, disadvantage being that people will likely forget what they added when removing the package.
What's the preferred way to do similar things?
Bonus points: if someone can comment on the following crazy shit - WTH is this, why'd that needed and is that even safe? Why's that in two different files in the first place?
These values are being crammed into /etc/sysctl.conf:
'kern.ipc.shmall' => '2097152', 'kern.ipc.shmmax' => '2147483648', 'kern.ipc.semmsl' => '250'
These values are being crammed into /boot/loader.conf:
'kern.ipc.semopm' => '100', 'kern.ipc.semmni' => '128', 'kern.ipc.semmns' => '32000', 'kern.ipc.shmmni' => '4096'
(copied from the zabbix stuff).
obviously(?) sysctl needs an API, so we can ensure it occurs correctly, and perhaps within some limit.