]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysctl-util: minimize side-effects when running `systemd-sysctl` 20676/head
authorAntony Deepak Thomas <antonydeepak@gmail.com>
Wed, 29 Sep 2021 04:07:42 +0000 (13:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 29 Sep 2021 04:07:47 +0000 (13:07 +0900)
commitab14aa23aeecf62414a3468d19c797505ad2778d
tree282c71a81f296e476dc6ca7d0dc92f34b0eb024e
parente565cfd2eb1a358e9ca5a414c5698ab893c4f140
sysctl-util: minimize side-effects when running `systemd-sysctl`

Currently `systemd-sysctl` binary is used in `systemd-sysctl.service`
which is mostly configured as `oneshot`. There are situations where one
would like to use systemd to maintain Sysctl configurations on a host,
using a configuration managers such as Chef or Puppet, by apply
configurations every X duration.
The problem with using `systemd-sysctl` is that it writes all the Sysctl
settings, even if the values for those settings have not changed. From
experience, we have observed that some Sysctl settings cause actions in
the kernel upon writing(like dropping caches) which in turn cause
undesired side effects.
This patch tries to minimize such side effects by comparing values
before writing.
src/basic/sysctl-util.c