[arch-projects] [PATCH] initscripts: load of sysctl files at startup
Hi Just a little patch to correct the load of the sysctl configuration file at startup. I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture. Feel free -- keys.gnupg.net: 0xEBCBE59D "J'ai toujours rêvé d'un ordinateur qui soit aussi facile à utiliser qu'un téléphone. Mon rêve s'est réalisé : je ne sais plus comment utiliser mon téléphone." Bjarne Stroustrup ------------ PATCH ----------------------- --- rc.multi.orig 2011-07-28 14:21:07.000000000 +0200 +++ rc.multi 2011-08-12 23:48:23.914340475 +0200 @@ -9,7 +9,10 @@ run_hook multi_start # Load sysctl variables if sysctl.conf is present -[[ -r /etc/sysctl.conf ]] && sysctl -q -p &>/dev/null +for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + [[ -r "${file}" ]] && sysctl -q -p "${file}" &> /dev/null +done +stat_done # Start daemons for daemon in "${DAEMONS[@]}"; do ------------------------------------------
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
Hi
Just a little patch to correct the load of the sysctl configuration file at startup.
And what needs to be corrected? Ignoring the additional directory you're pulling from), your patch exhibits no change in behavior for loading the default /etc/sysctl.conf.
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch. d
-- keys.gnupg.net: 0xEBCBE59D
"J'ai toujours rêvé d'un ordinateur qui soit aussi facile à utiliser qu'un téléphone. Mon rêve s'est réalisé : je ne sais plus comment utiliser mon téléphone."
Bjarne Stroustrup
------------ PATCH ----------------------- --- rc.multi.orig 2011-07-28 14:21:07.000000000 +0200 +++ rc.multi 2011-08-12 23:48:23.914340475 +0200 @@ -9,7 +9,10 @@ run_hook multi_start
# Load sysctl variables if sysctl.conf is present -[[ -r /etc/sysctl.conf ]] && sysctl -q -p &>/dev/null +for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + [[ -r "${file}" ]] && sysctl -q -p "${file}" &> /dev/null +done +stat_done
# Start daemons for daemon in "${DAEMONS[@]}"; do
------------------------------------------
--- rc.multi.orig 2011-07-28 14:21:07.000000000 +0200 +++ rc.multi 2011-08-12 23:48:23.914340475 +0200 @@ -9,7 +9,10 @@ run_hook multi_start
# Load sysctl variables if sysctl.conf is present -[[ -r /etc/sysctl.conf ]] && sysctl -q -p &>/dev/null +for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + [[ -r "${file}" ]] && sysctl -q -p "${file}" &> /dev/null +done +stat_done
# Start daemons for daemon in "${DAEMONS[@]}"; do
On Sun, Aug 28, 2011 at 11:51 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
I agree with Dave, if we are going to support this there should be at least one user of it. Are there any packages that either already ship with their own sysctl file, or that would benefit from doing it? If we are going to support a sysctl.d directory, I think we should do it in exactly the same way as systemd does (being almost, but not quite, the same would only be confusing): <http://0pointer.de/public/systemd-man/sysctl.d.html>. Cheers, Tom
On Mon, Aug 29, 2011 at 12:17 AM, Tom Gundersen <teg@jklm.no> wrote:
On Sun, Aug 28, 2011 at 11:51 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
I agree with Dave, if we are going to support this there should be at least one user of it. Are there any packages that either already ship with their own sysctl file, or that would benefit from doing it? As /etc/udev/rules.d, sysctl.d can be reserved for users.
It's a very pratical way of setting system config. Make it a default, is a good advice for users. It will maybe also help packager which want add some systcl param. (chicken or the egg?)
If we are going to support a sysctl.d directory, I think we should do it in exactly the same way as systemd does (being almost, but not quite, the same would only be confusing): <http://0pointer.de/public/systemd-man/sysctl.d.html>.
I read quickly, but Debian do the sames -- Sébastien Luttringer www.seblu.net
On Mon, Aug 29, 2011 at 7:26 PM, Seblu <seblu@seblu.net> wrote:
On Mon, Aug 29, 2011 at 12:17 AM, Tom Gundersen <teg@jklm.no> wrote:
On Sun, Aug 28, 2011 at 11:51 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
I agree with Dave, if we are going to support this there should be at least one user of it. Are there any packages that either already ship with their own sysctl file, or that would benefit from doing it? As /etc/udev/rules.d, sysctl.d can be reserved for users.
It's a very pratical way of setting system config. Make it a default, is a good advice for users. It will maybe also help packager which want add some systcl param. (chicken or the egg?)
I'm all for it if we have users (packages). I.e. if there are packages that could use this, I'd be happy to merge a patch. A candidate would be any package that instructs the user to add something to sysctl.conf. I have not seen this, but maybe it exists. If we start shipping files in /usr/lib/sysctl.d/, then the counerpart in /etc makes sense for user files and as an override mechanism. However, if there are no shipped files, then the user might as well keep all the config in /etc/sysctl.conf. -t
On Mon, Aug 29, 2011 at 08:10:32PM +0200, Tom Gundersen wrote:
On Mon, Aug 29, 2011 at 7:26 PM, Seblu <seblu@seblu.net> wrote:
On Mon, Aug 29, 2011 at 12:17 AM, Tom Gundersen <teg@jklm.no> wrote:
On Sun, Aug 28, 2011 at 11:51 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
I agree with Dave, if we are going to support this there should be at least one user of it. Are there any packages that either already ship with their own sysctl file, or that would benefit from doing it? As /etc/udev/rules.d, sysctl.d can be reserved for users.
It's a very pratical way of setting system config. Make it a default, is a good advice for users. It will maybe also help packager which want add some systcl param. (chicken or the egg?)
I'm all for it if we have users (packages). I.e. if there are packages that could use this, I'd be happy to merge a patch. A candidate would be any package that instructs the user to add something to sysctl.conf. I have not seen this, but maybe it exists.
Well... ---- $ grep 'sysctl.conf' /var/abs/*/*/*.install /var/abs/community/radvd/radvd.install:add the following line to /etc/sysctl.conf: ----
If we start shipping files in /usr/lib/sysctl.d/, then the counerpart in /etc makes sense for user files and as an override mechanism. However, if there are no shipped files, then the user might as well keep all the config in /etc/sysctl.conf.
-t
On Mon, Aug 29, 2011 at 8:10 PM, Tom Gundersen <teg@jklm.no> wrote:
On Mon, Aug 29, 2011 at 7:26 PM, Seblu <seblu@seblu.net> wrote:
On Mon, Aug 29, 2011 at 12:17 AM, Tom Gundersen <teg@jklm.no> wrote:
On Sun, Aug 28, 2011 at 11:51 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
I agree with Dave, if we are going to support this there should be at least one user of it. Are there any packages that either already ship with their own sysctl file, or that would benefit from doing it? As /etc/udev/rules.d, sysctl.d can be reserved for users.
It's a very pratical way of setting system config. Make it a default, is a good advice for users. It will maybe also help packager which want add some systcl param. (chicken or the egg?)
I'm all for it if we have users (packages). I.e. if there are packages that could use this, I'd be happy to merge a patch. A candidate would be any package that instructs the user to add something to sysctl.conf. I have not seen this, but maybe it exists. As lukas point it, we have currently one candidate.
I don't understand something, even if we doesn't have any package using /etc/sysctl.d is an handy way of adding config to sysctl for *real* users.
If we start shipping files in /usr/lib/sysctl.d/, then the counerpart in /etc makes sense for user files and as an override mechanism. However, if there are no shipped files, then the user might as well keep all the config in /etc/sysctl.conf.
You want to remove /etc/sysctl.conf or keep it? If i understand right systemd suggestion, there is no /etc/sysctl.conf. In this case we have one more cantidate. $ pacman -Qo /etc/sysctl.conf /etc/sysctl.conf is owned by procps 3.2.8-4 Regards, -- Sébastien Luttringer www.seblu.net
Hi all, On Tue, Aug 30, 2011 at 3:36 PM, Seblu <seblu@seblu.net> wrote:
I don't understand something, even if we doesn't have any package using /etc/sysctl.d is an handy way of adding config to sysctl for *real* users.
So even if the number of packages that might need this was underwhelming, Seblu convinced me in a chat that it might still be a good thing to have for an admin. The way I understood it was that he has a collection of .conf files, each of which has a different purpose (such as "laptop", "noswap", "xen", etc). Then it is much simpler to drop one of these files into one of his machine's /etc/sysctl.d/ directories than to have to edit /etc/sysctl.conf. This sounds fair enough to me. So if anyone want to implement the standard outlined in the systemd manpage I'd be happy to merge it (please coordinate a bit, so not two people start working on the same thing though). Maybe inspiration can be taken from Dave's arch-tmpfiles script for how to deal with precedence of config file dirs. We should keep backwards compatibility and always load /etc/sysctl.conf. Cheers, Tom
Le dimanche 28 août 2011 à 17:51:38 (-0400), Dave Reisner a écrit :
On Sun, Aug 28, 2011 at 11:44:17PM +0200, Earendil wrote:
Hi
Just a little patch to correct the load of the sysctl configuration file at startup.
And what needs to be corrected? Ignoring the additional directory you're pulling from), your patch exhibits no change in behavior for loading the default /etc/sysctl.conf.
You're right : I have made tests with my configuration : now, everything is OK. I think I had made an errors somewhere but where…
I have also added the capability to stip th sysctl.conf files in many files in the sysctl.d directory. This idea was inspired by Debian architecture.
Sure, systemd uses this as well. Do we have any cases where distributing a sysctl file with a package is needed? I'm really not sure this is something that's wanted/needed in Arch.
d
It was just an idea : I like the ability to not disturbed the main configuration files with my own tests. And the presence of the directory is not mandatory, so we don’t need to add it to the package. But I’m agree : It's not needed. Ea
-- keys.gnupg.net: 0xEBCBE59D
"J'ai toujours rêvé d'un ordinateur qui soit aussi facile à utiliser qu'un téléphone. Mon rêve s'est réalisé : je ne sais plus comment utiliser mon téléphone."
Bjarne Stroustrup
------------ PATCH ----------------------- --- rc.multi.orig 2011-07-28 14:21:07.000000000 +0200 +++ rc.multi 2011-08-12 23:48:23.914340475 +0200 @@ -9,7 +9,10 @@ run_hook multi_start
# Load sysctl variables if sysctl.conf is present -[[ -r /etc/sysctl.conf ]] && sysctl -q -p &>/dev/null +for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + [[ -r "${file}" ]] && sysctl -q -p "${file}" &> /dev/null +done +stat_done
# Start daemons for daemon in "${DAEMONS[@]}"; do
------------------------------------------
--- rc.multi.orig 2011-07-28 14:21:07.000000000 +0200 +++ rc.multi 2011-08-12 23:48:23.914340475 +0200 @@ -9,7 +9,10 @@ run_hook multi_start
# Load sysctl variables if sysctl.conf is present -[[ -r /etc/sysctl.conf ]] && sysctl -q -p &>/dev/null +for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + [[ -r "${file}" ]] && sysctl -q -p "${file}" &> /dev/null +done +stat_done
# Start daemons for daemon in "${DAEMONS[@]}"; do
participants (5)
-
Dave Reisner
-
Earendil
-
Lukas Fleischer
-
Seblu
-
Tom Gundersen