]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysctl: add --strict option to fail if sysctl does not exists
authorQuentin Deslandes <qdeslandes@naccy.de>
Fri, 22 Jul 2022 15:18:15 +0000 (17:18 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 25 Jul 2022 08:15:43 +0000 (10:15 +0200)
commite88748c17e58aad6818e64fd3071de011808165e
tree0fa58bda1d6993d81d5c1ba837147e1cd68febc3
parent3657d3a01c7e25ff86d7a4642065b367c4ff7484
sysctl: add --strict option to fail if sysctl does not exists

systemd-sysctl currently fails silently under any of these conditions:
- Missing permission to write a sysctl.
- Invalid sysctl (path doesn't exists).
- Ignore failure flag ('-' in front of the sysctl name).

Because of this behaviour, configuration issues can go unnoticed as
there is no way to detect those unless going through the logs.

--strict option forces systemd-sysctl to fail if a sysctl is invalid or
if permission are insufficient. Errors on sysctl marked as "ignore
failure" will still be ignored.
man/systemd-sysctl.service.xml
src/sysctl/sysctl.c
test/TEST-76-SYSCTL/Makefile [new file with mode: 0644]
test/TEST-76-SYSCTL/test.sh [new file with mode: 0755]
test/units/testsuite-76.service [new file with mode: 0644]
test/units/testsuite-76.sh [new file with mode: 0755]