SHA256
1
0
forked from pool/procps
procps/procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
Dirk Mueller ad8ffc4215 Accepting request 1190400 from home:dimstar:Factory
- Switch to procps 4 branch, bsorbing the former procps4 package:
  + Add provides/obsoletes procps4: make zypper replace procps4
    with the main package for users that manually switched.

Do the final switch to procs4; the issues from 2022 (e.g. salt) should be
fixed.

OBS-URL: https://build.opensuse.org/request/show/1190400
OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=254
2024-07-30 22:00:16 +00:00

52 lines
1.3 KiB
Diff

---
man/sysctl.8 | 2 ++
src/sysctl.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
--- man/sysctl.8
+++ man/sysctl.8 2022-03-29 10:21:47.926686046 +0000
@@ -123,6 +123,8 @@ will read files from directories in the
order from top to bottom. Once a file of a given filename is loaded, any
file of the same name in subsequent directories is ignored.
+/boot/sysctl.conf-<kernelversion>
+.br
/etc/sysctl.d/*.conf
.br
/run/sysctl.d/*.conf
--- src/sysctl.c
+++ src/sysctl.c 2022-03-29 10:20:51.795708321 +0000
@@ -45,6 +45,7 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <unistd.h>
#include <ctype.h>
@@ -808,6 +809,7 @@ static int sortpairs(const void *A, cons
static int PreloadSystem(SettingList *setlist)
{
unsigned di, i;
+ struct utsname uts;
const char *dirs[] = {
"/etc/sysctl.d",
"/run/sysctl.d",
@@ -872,6 +874,16 @@ static int PreloadSystem(SettingList *se
}
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) {
+ if (!Quiet)
+ printf("* Applying %s ...\n", buf);
+ Preload(setlist, buf);
+ }
+ }
+
for (i = 0; i < ncfgs; ++i) {
if (!Quiet)
printf(_("* Applying %s ...\n"), cfgs[i]->value);