Fix #47: Relocate sysctl.conf setup to procps plugin

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-12-08 08:17:38 +01:00
parent 5b12d17b56
commit 892ac2edb2
3 changed files with 78 additions and 23 deletions
+2 -21
View File
@@ -25,7 +25,6 @@
#include "config.h" /* Generated by configure script */
#include <ctype.h>
#include <glob.h>
#include <dirent.h>
#ifdef HAVE_FSTAB_H
#include <fstab.h>
@@ -121,26 +120,7 @@ static int fsck(int pass)
static void networking(void)
{
size_t i;
glob_t gl;
FILE *fp;
char buf[160];
/* Setup kernel specific settings, e.g. allow broadcast ping, etc. */
glob("/run/sysctl.d/*.conf", 0, NULL, &gl);
glob("/etc/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
glob("/usr/local/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
glob("/usr/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
glob("/lib/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
glob("/mnt/sysctl.d/*.conf", GLOB_APPEND, NULL, &gl);
glob("/etc/sysctl.conf", GLOB_APPEND, NULL, &gl);
if (gl.gl_pathc > 0) {
for (i = 0; i < gl.gl_pathc; i++) {
snprintf(buf, sizeof(buf), "/sbin/sysctl -e -p %s >/dev/null", gl.gl_pathv[i]);
run(buf);
}
globfree(&gl);
}
/* Run user network start script if enabled */
if (network) {
@@ -151,7 +131,8 @@ static void networking(void)
/* Debian/Ubuntu/Busybox interfaces file */
fp = fopen("/etc/network/interfaces", "r");
if (fp) {
i = 0;
int i = 0;
char buf[160];
/* Bring up all 'auto' interfaces */
while (fgets(buf, sizeof(buf), fp)) {