You are not logged in.
Greetings,
I am currently working on an AUR package, and after the package is installed correctly, I need to execute sysctl to modify a setting on the system.
My first question is, is this even a good idea? Or ask the user with an echo to run the sysctl command themselves?
If it is cool with AUR, what would be the approved method to drop a file in /etc/sysctl.d/99-namehere.conf and activate it after the package is installed?
Thanks in advance
Offline
My first question is, is this even a good idea? Or ask the user with an echo to run the sysctl command themselves?
No to the first, yes to the second as a reasonable option, but ...
what would be the approved method to drop a file in /etc/sysctl.d/99-namehere.conf
You don't. You install it to /usr/lib/sysctl.d/ and use a post install message to instruct the user to copy/link that to /etc/sysctl.d/.
EDIT: perhaps not. I suspected /usr/lib/sysctl.d was a staging place for bits that could be 'activated' by placing them in /etc/, but it seems they are read too. So my suggestion would be to just echo a message telling a user to create such a file. Though this may depend to a degree on exactly what the setting is. If the setting is absolutely essential for your packaged software to work at all and it will not have *any* other side effects, then perhaps you could just package the file for the setting.
Last edited by Trilby (2018-09-07 14:27:00)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sounds good. Thank you so much for the prompt reply, it was a big a help.
Offline
Note also, that the systemd package provides a pacman hook /usr/share/libalpm/hooks/systemd-sysctl.hook
So sysctl settings will be automatically updated, by default.
Note that I make no claims to the advisability (or not) of setting any sysctl in the first place. I merely point out that if you do use one, there's no need to do anything or message the user in the post-install, in order to apply it.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline