Summary: | sys-process/procps-3.3.9 with >=sys-apps/openrc-0.13: /etc/init.d/sysctl: sysctl --system ignores /etc/sysctl.conf | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Sergey Popov <pinkbyte> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dwfreed, james05+gentoo, openrc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | http://bugs.debian.org/732920 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Fix for logic error in sysctl.c |
Description
Sergey Popov
2014-08-20 12:27:47 UTC
This was broken in cdca71e94506fbb921ab2c626be3ad05c4287498 in upstream procps, and "fixed" in 7f6efed9bb85d1e212e06985ea3e06720f6ca949. The fix contains a logic error of its own. Instead of: if (stat(DEFAULT_PRELOAD, &ts) < 0 || S_ISREG(ts.st_mode)) { It should be: if (stat(DEFAULT_PRELOAD, &ts) == 0 && S_ISREG(ts.st_mode)) { Created attachment 383198 [details, diff]
Fix for logic error in sysctl.c
Using the just-attached patch: Before: # strace -e trace=file sysctl --system execve("/sbin/sysctl", ["sysctl", "--system"], [/* 44 vars */]) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/run/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/usr/local/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/etc/sysctl.conf", {st_mode=S_IFREG|0644, st_size=1595, ...}) = 0 +++ exited with 0 +++ # After: # strace -e trace=file ./sysctl --system execve("./sysctl", ["./sysctl", "--system"], [/* 45 vars */]) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 [...] openat(AT_FDCWD, "/run/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 openat(AT_FDCWD, "/usr/local/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/lib/sysctl.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/etc/sysctl.conf", {st_mode=S_IFREG|0644, st_size=1595, ...}) = 0 * Applying /etc/sysctl.conf ... open("/etc/sysctl.conf", O_RDONLY) = 3 [...] And the file is loaded. (In reply to Tobias Klausmann from comment #2) > Created attachment 383198 [details, diff] [details, diff] > Fix for logic error in sysctl.c in portage, as procps-3.3.9-r2 *** Bug 520292 has been marked as a duplicate of this bug. *** |