Hello community, here is the log from the commit of package procps for openSUSE:Factory checked in at Mon Aug 29 09:21:24 CEST 2011. -------- --- procps/procps.changes 2011-08-24 12:15:32.000000000 +0200 +++ /mounts/work_src_done/STABLE/procps/procps.changes 2011-08-26 14:44:08.000000000 +0200 @@ -1,0 +2,10 @@ +Fri Aug 26 12:41:30 UTC 2011 - lnussel@suse.de + +- add some docu to /etc/sysctl.conf (bnc#700174) + +------------------------------------------------------------------- +Fri Aug 26 09:36:03 UTC 2011 - lnussel@suse.de + +- make --system switch compatible with udev/systemd scheme + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ procps.spec ++++++ --- /var/tmp/diff_new_pack.zEn4Jq/_old 2011-08-29 09:15:44.000000000 +0200 +++ /var/tmp/diff_new_pack.zEn4Jq/_new 2011-08-29 09:15:44.000000000 +0200 @@ -27,7 +27,7 @@ PreReq: %fillup_prereq %insserv_prereq AutoReqProv: on Version: 3.2.8 -Release: 37 +Release: 39 Summary: ps utilities for /proc Provides: ps Obsoletes: ps @@ -181,7 +181,27 @@ %post %{fillup_and_insserv -ny boot.sysctl boot.sysctl} # -test -e /etc/sysctl.conf || > /etc/sysctl.conf +test -e /etc/sysctl.conf || cat <<EOF >/etc/sysctl.conf +#### +# +# /etc/sysctl.conf is meant for local sysctl settings +# +# sysctl reads settings from the following locations: +# /boot/sysctl.conf-<kernelversion> +# /lib/sysctl.d/*.conf +# /usr/lib/sysctl.conf.d/*.conf +# /usr/local/lib/sysctl.d/*.conf +# /etc/sysctl.d/*.conf +# /run/sysctl.d/*.conf +# /etc/sysctl.conf +# +# To disable or override a distribution provided file just place a +# file with the same name in /etc/sysctl.d/ +# +# See sysctl.conf(5) and sysctl(8) for more information +# +#### +EOF %postun %insserv_cleanup ++++++ procps-3.2.8-add-system-switch.diff ++++++ --- /var/tmp/diff_new_pack.zEn4Jq/_old 2011-08-29 09:15:44.000000000 +0200 +++ /var/tmp/diff_new_pack.zEn4Jq/_new 2011-08-29 09:15:44.000000000 +0200 @@ -1,58 +1,117 @@ -From 45915cfc03fb82b68425445063a0bcebab1ff230 Mon Sep 17 00:00:00 2001 +From f09de20e534804464d89d76c607ac877573ad9fe Mon Sep 17 00:00:00 2001 From: Ludwig Nussel <ludwig.nussel@suse.de> -Date: Wed, 18 May 2011 08:16:39 +0200 -Subject: [PATCH procps 1/3] add --system switch +Date: Fri, 26 Aug 2011 11:11:50 +0200 +Subject: [PATCH 1/3] add --system switch instead of requiring distributions to construct a loop around sysctl in boot scripts just scan a set of default directories if the --system switch is used. +Config files are applied in alphabetic order of their base name. +Each base name is only applied once according to the directory +preference. /etc/sysctl.conf is always applied last. --- - sysctl.c | 35 +++++++++++++++++++++++++++++++++++ - 1 files changed, 35 insertions(+), 0 deletions(-) + sysctl.8 | 5 ++++ + sysctl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 79 insertions(+), 0 deletions(-) +diff --git a/sysctl.8 b/sysctl.8 +index e26c4fb..d2b0ceb 100644 +--- a/sysctl.8 ++++ b/sysctl.8 +@@ -64,6 +64,11 @@ Display all values currently available. + .TP + .B "-A" + Display all values currently available in table form. ++.TP ++.B "--system" ++Load settings from system configuration files (/lib/sysctl.d/*.conf, ++/usr/lib/sysctl.d/*.conf, /usr/local/lib/sysctl.d/*.conf, ++/etc/sysctl.d/*.conf, /run/sysctl.d/*.conf, /etc/sysctl.conf) + .SH EXAMPLES + .TP + /sbin/sysctl -a diff --git a/sysctl.c b/sysctl.c -index 9be79ce..3445efe 100644 +index 9be79ce..bf4e529 100644 --- a/sysctl.c +++ b/sysctl.c -@@ -453,6 +453,37 @@ static int Preload(const char *restrict const filename) { +@@ -453,6 +453,76 @@ static int Preload(const char *restrict const filename) { return rc; } ++struct pair { ++ char* name; ++ char* value; ++}; ++ ++static int sortpairs(const void* A, const void* B) ++{ ++ const struct pair* a = *(struct pair* const*)A; ++ const struct pair* b = *(struct pair* const*)B; ++ return strcmp(a->name, b->name); ++} ++ +static int PreloadSystem(void) { -+ unsigned i; ++ unsigned di, i; + const char* dirs[] = { -+ "/lib/sysctl.d", -+ "/usr/lib/sysctl.d", -+ "/usr/local/lib/sysctl.d", ++ "/run/sysctl.d", + "/etc/sysctl.d", ++ "/usr/local/lib/sysctl.d", ++ "/usr/lib/sysctl.d", ++ "/lib/sysctl.d", + }; -+ for (i=0; i < sizeof(dirs)/sizeof(dirs[0]); ++i) { ++ struct pair** cfgs = NULL; ++ unsigned ncfgs = 0; ++ enum { nprealloc = 16 }; ++ ++ for (di=0; di < sizeof(dirs)/sizeof(dirs[0]); ++di) { + struct dirent* de; -+ DIR* dp = opendir(dirs[i]); ++ DIR* dp = opendir(dirs[di]); + if (!dp) -+ continue; ++ continue; + while (( de = readdir(dp) )) { -+ char buf[PATH_MAX]; -+ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) { -+ continue; -+ } -+ if (strlen(de->d_name) < 6 || !strcmp(de->d_name+strlen(de->d_name)-6, ".conf")) -+ continue; -+ snprintf(buf, sizeof(buf), "%s/%s", dirs[i], de->d_name); -+ if (!Quiet) -+ printf("* Applying %s ...\n", buf); -+ Preload(buf); ++ if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) { ++ continue; ++ } ++ if (strlen(de->d_name) < 6 || !strcmp(de->d_name+strlen(de->d_name)-6, ".conf")) ++ continue; ++ /* check if config already known */ ++ for (i = 0; i < ncfgs; ++i) { ++ if (!strcmp(cfgs[i]->name, de->d_name)) ++ break; ++ } ++ if (i < ncfgs) // already in ++ continue; ++ ++ if (ncfgs % nprealloc == 0) { ++ cfgs = realloc(cfgs, sizeof(struct pair*)*(ncfgs+nprealloc)); ++ } ++ cfgs[ncfgs] = malloc(sizeof(struct pair) + strlen(de->d_name)*2+2 + strlen(dirs[di])+1); ++ cfgs[ncfgs]->name = (char*)cfgs[ncfgs]+sizeof(struct pair); ++ strcpy(cfgs[ncfgs]->name, de->d_name); ++ cfgs[ncfgs]->value = (char*)cfgs[ncfgs]+sizeof(struct pair) + strlen(cfgs[ncfgs]->name)+1; ++ sprintf(cfgs[ncfgs]->value, "%s/%s", dirs[di], de->d_name); ++ ncfgs++; ++ + } + closedir(dp); -+ } -+ if (!Quiet) -+ printf("* Applying %s ...\n", DEFAULT_PRELOAD); -+ return Preload(DEFAULT_PRELOAD); ++ } ++ ++ qsort(cfgs, ncfgs, sizeof(struct cfg*), sortpairs); ++ ++ for (i = 0; i < ncfgs; ++i) { ++ if (!Quiet) ++ printf("* Applying %s ...\n", cfgs[i]->value); ++ Preload(cfgs[i]->value); ++ } ++ ++ if (!Quiet) ++ printf("* Applying %s ...\n", DEFAULT_PRELOAD); ++ return Preload(DEFAULT_PRELOAD); +} /* -@@ -488,6 +519,10 @@ int main(int argc, char *argv[]) { +@@ -488,6 +558,10 @@ int main(int argc, char *argv[]) { fprintf(stdout, "sysctl (%s)\n",procps_version); exit(0); } ++++++ procps-3.2.8-implement-pattern-option.diff ++++++ --- /var/tmp/diff_new_pack.zEn4Jq/_old 2011-08-29 09:15:44.000000000 +0200 +++ /var/tmp/diff_new_pack.zEn4Jq/_new 2011-08-29 09:15:44.000000000 +0200 @@ -1,28 +1,23 @@ -From b73ff507f616c74ac94e7b1bef2ce51fa9bb2806 Mon Sep 17 00:00:00 2001 +From 596511f915e210d27c84eaca0a5b4c7c48ec96e0 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel <ludwig.nussel@suse.de> -Date: Wed, 18 May 2011 08:20:09 +0200 -Subject: [PATCH procps 2/3] implement --pattern option +Date: Fri, 26 Aug 2011 11:31:39 +0200 +Subject: [PATCH 2/3] implement --pattern option Useful for e.g network hook scripts together with --system to only apply sysctls for a specific network interface. --- - sysctl.8 | 14 ++++++++++++++ - sysctl.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 66 insertions(+), 0 deletions(-) + sysctl.8 | 10 ++++++++- + sysctl.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- + 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/sysctl.8 b/sysctl.8 -index e26c4fb..9f6de65 100644 +index d2b0ceb..406bb59 100644 --- a/sysctl.8 +++ b/sysctl.8 -@@ -64,6 +64,16 @@ Display all values currently available. - .TP - .B "-A" - Display all values currently available in table form. -+.TP -+.B "--system" -+Load settings from system configuration files (/lib/sysctl.d/*.conf, -+/usr/lib/sysctl.d/*.conf, /usr/local/lib/sysctl.d/*.conf, -+/etc/sysctl.d/*.conf, /etc/sysctl.conf) +@@ -69,6 +69,11 @@ Display all values currently available in table form. + Load settings from system configuration files (/lib/sysctl.d/*.conf, + /usr/lib/sysctl.d/*.conf, /usr/local/lib/sysctl.d/*.conf, + /etc/sysctl.d/*.conf, /run/sysctl.d/*.conf, /etc/sysctl.conf) +.TP +.B "--pattern" PATTERN +Ignore settings that don't patch PATTERN. A star '*' is recognized @@ -31,10 +26,11 @@ .SH EXAMPLES .TP /sbin/sysctl -a -@@ -73,6 +83,10 @@ Display all values currently available in table form. +@@ -77,7 +82,10 @@ Load settings from system configuration files (/lib/sysctl.d/*.conf, + .TP /sbin/sysctl -w kernel.domainname="example.com" .TP - /sbin/sysctl -p /etc/sysctl.conf +-/sbin/sysctl -p /etc/sysctl.conf +.TP +/sbin/sysctl --pattern 'net.ipv4.conf.*.forwarding' -a +.TP @@ -43,7 +39,7 @@ .I /proc/sys .I /etc/sysctl.conf diff --git a/sysctl.c b/sysctl.c -index 3445efe..b68170b 100644 +index bf4e529..1867777 100644 --- a/sysctl.c +++ b/sysctl.c @@ -50,6 +50,7 @@ static bool PrintName; @@ -62,21 +58,37 @@ static void slashdot(char *restrict p, char old, char new){ p = strpbrk(p,"/."); -@@ -145,6 +147,10 @@ static int ReadSetting(const char *restrict const name) { - outname = strdup(name); - slashdot(outname,'/','.'); /* change / to . */ - +@@ -135,16 +137,21 @@ static int ReadSetting(const char *restrict const name) { + return -1; + } + ++ /* used to display the output */ ++ outname = strdup(name); ++ slashdot(outname,'/','.'); /* change / to . */ ++ + if (pattern && !pattern_match(outname)){ -+ goto out; ++ free(outname); ++ return 0; + } + + /* used to open the file */ + tmpname = malloc(strlen(name)+strlen(PROC_PATH)+2); + strcpy(tmpname, PROC_PATH); + strcat(tmpname, name); + slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */ + +- /* used to display the output */ +- outname = strdup(name); +- slashdot(outname,'/','.'); /* change / to . */ +- if (stat(tmpname, &ts) < 0) { if (!IgnoreError) { perror(tmpname); -@@ -391,7 +397,39 @@ out: +@@ -391,7 +398,39 @@ out: return rc; } +- +static int pattern_match(const char* name) { + const char* p = pattern; + if (!p || !name) @@ -101,7 +113,7 @@ + } + if (*p != *name) + return 0; - ++ + ++p; + ++name; + continue; @@ -113,7 +125,7 @@ /* * Preload the sysctl's from the conf file -@@ -435,6 +473,10 @@ static int Preload(const char *restrict const filename) { +@@ -435,6 +474,10 @@ static int Preload(const char *restrict const filename) { StripLeadingAndTrailingSpaces(name); @@ -124,7 +136,7 @@ value = strtok(NULL, "\n\r"); if (!value || !*value) { fprintf(stderr, WARN_BAD_LINE, filename, n); -@@ -523,6 +565,16 @@ int main(int argc, char *argv[]) { +@@ -562,6 +605,16 @@ int main(int argc, char *argv[]) { IgnoreError = true; return PreloadSystem(); } ++++++ procps-3.2.8-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff ++++++ --- /var/tmp/diff_new_pack.zEn4Jq/_old 2011-08-29 09:15:44.000000000 +0200 +++ /var/tmp/diff_new_pack.zEn4Jq/_new 2011-08-29 09:15:44.000000000 +0200 @@ -1,14 +1,28 @@ -From 40c2bfe16c9a9e9562c686afa9d6b7f754a5c8d9 Mon Sep 17 00:00:00 2001 +From 0d9241b9af6ad3533477b11583c3e866cc2e6fd3 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel <ludwig.nussel@suse.de> Date: Tue, 17 May 2011 16:35:18 +0200 -Subject: [PATCH procps 3/3] read sysctls also from /boot/sysctl.conf-$kernelversion +Subject: [PATCH 3/3] read sysctls also from /boot/sysctl.conf-$kernelversion --- - sysctl.c | 10 ++++++++++ - 1 files changed, 10 insertions(+), 0 deletions(-) + sysctl.8 | 2 +- + sysctl.c | 12 ++++++++++++ + 2 files changed, 13 insertions(+), 1 deletions(-) +diff --git a/sysctl.8 b/sysctl.8 +index 406bb59..03a8980 100644 +--- a/sysctl.8 ++++ b/sysctl.8 +@@ -66,7 +66,7 @@ Display all values currently available. + Display all values currently available in table form. + .TP + .B "--system" +-Load settings from system configuration files (/lib/sysctl.d/*.conf, ++Load settings from system configuration files (/boot/sysctl.conf-<kernelversion>, /lib/sysctl.d/*.conf, + /usr/lib/sysctl.d/*.conf, /usr/local/lib/sysctl.d/*.conf, + /etc/sysctl.d/*.conf, /run/sysctl.d/*.conf, /etc/sysctl.conf) + .TP diff --git a/sysctl.c b/sysctl.c -index b68170b..6967ca8 100644 +index 1867777..a38a81c 100644 --- a/sysctl.c +++ b/sysctl.c @@ -27,6 +27,7 @@ @@ -19,28 +33,31 @@ #include <dirent.h> #include <string.h> #include <errno.h> -@@ -497,12 +498,21 @@ static int Preload(const char *restrict const filename) { +@@ -510,6 +511,7 @@ static int sortpairs(const void* A, const void* B) static int PreloadSystem(void) { - unsigned i; + unsigned di, i; + struct utsname uts; const char* dirs[] = { - "/lib/sysctl.d", - "/usr/lib/sysctl.d", - "/usr/local/lib/sysctl.d", + "/run/sysctl.d", "/etc/sysctl.d", - }; +@@ -556,6 +558,16 @@ static int PreloadSystem(void) { + + qsort(cfgs, ncfgs, sizeof(struct cfg*), sortpairs); + + if (uname(&uts) == 0) { -+ char buf[PATH_MAX]; -+ snprintf(buf, sizeof(buf), "/boot/sysctl.conf-%s", uts.release); -+ if (access(buf, R_OK) == 0) { -+ printf("* Applying %s ...\n", buf); -+ Preload(buf); -+ } ++ char buf[PATH_MAX]; ++ snprintf(buf, sizeof(buf), "/boot/sysctl.conf-%s", uts.release); ++ if (access(buf, R_OK) == 0) { ++ if (!Quiet) ++ printf("* Applying %s ...\n", buf); ++ Preload(buf); ++ } + } - for (i=0; i < sizeof(dirs)/sizeof(dirs[0]); ++i) { - struct dirent* de; - DIR* dp = opendir(dirs[i]); ++ + for (i = 0; i < ncfgs; ++i) { + if (!Quiet) + printf("* Applying %s ...\n", cfgs[i]->value); -- 1.7.3.4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org