2016-07-11 15:33:05 +02:00
|
|
|
---
|
|
|
|
sysctl.8 | 2 ++
|
|
|
|
sysctl.c | 12 ++++++++++++
|
|
|
|
2 files changed, 14 insertions(+)
|
|
|
|
|
2012-06-04 16:22:08 +02:00
|
|
|
--- sysctl.8
|
2022-03-29 14:56:32 +02:00
|
|
|
+++ sysctl.8 2022-03-29 10:21:47.926686046 +0000
|
|
|
|
@@ -117,6 +117,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.
|
|
|
|
|
2012-06-04 16:22:08 +02:00
|
|
|
+/boot/sysctl.conf-<kernelversion>
|
|
|
|
+.br
|
|
|
|
/etc/sysctl.d/*.conf
|
2021-02-10 11:58:18 +01:00
|
|
|
.br
|
|
|
|
/run/sysctl.d/*.conf
|
2012-06-04 16:22:08 +02:00
|
|
|
--- sysctl.c
|
2022-03-29 14:56:32 +02:00
|
|
|
+++ sysctl.c 2022-03-29 10:20:51.795708321 +0000
|
|
|
|
@@ -40,6 +40,7 @@
|
2012-06-04 16:22:08 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
+#include <sys/utsname.h>
|
|
|
|
#include <unistd.h>
|
2022-03-29 14:56:32 +02:00
|
|
|
#include <ctype.h>
|
2012-06-04 16:22:08 +02:00
|
|
|
|
2022-03-29 14:56:32 +02:00
|
|
|
@@ -794,6 +795,7 @@ static int sortpairs(const void *A, cons
|
|
|
|
static int PreloadSystem(SettingList *setlist)
|
2012-06-04 16:22:08 +02:00
|
|
|
{
|
|
|
|
unsigned di, i;
|
|
|
|
+ struct utsname uts;
|
|
|
|
const char *dirs[] = {
|
|
|
|
"/etc/sysctl.d",
|
2021-02-10 11:58:18 +01:00
|
|
|
"/run/sysctl.d",
|
2022-03-29 14:56:32 +02:00
|
|
|
@@ -858,6 +860,16 @@ static int PreloadSystem(SettingList *se
|
2012-06-04 16:22:08 +02:00
|
|
|
}
|
|
|
|
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);
|
2022-03-29 14:56:32 +02:00
|
|
|
+ Preload(setlist, buf);
|
2012-06-04 16:22:08 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
for (i = 0; i < ncfgs; ++i) {
|
|
|
|
if (!Quiet)
|
|
|
|
printf(_("* Applying %s ...\n"), cfgs[i]->value);
|