[systemd-devel] Antw: [EXT] Re: Q: Change a kernel setting
Ulrich Windl
Ulrich.Windl at rz.uni-regensburg.de
Fri Jul 29 09:41:24 UTC 2022
>>> Tomasz Torcz <tomek at pipebreaker.pl> schrieb am 29.07.2022 um 11:01 in
Nachricht
<YuOhzq6Ib6XYTWWI at mother.pipebreaker.pl>:
> On Fri, Jul 29, 2022 at 08:45:51AM +0200, Ulrich Windl wrote:
>> Hi!
>>
>> I wonder: What is the recommended way to do this with systemd?:
>> ---
>> Add the following command to a script executed on system boot, such as
> /etc/init.d/boot.local:
>>
>> # echo 0 > /sys/kernel/mm/ksm/run
>> ---
>> Do I have to write a unit for it, or is there some generic mechanism
> already?
>
> You can use tmpfiles. In the manpage
> (https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html)
> there's a following example, which you can adapt:
>
> # Modify sysfs but don't fail if we are in a container with a read-only
> /proc
> w- /proc/sys/vm/swappiness - - - - 10
Great, thanks!
>
>
> --
> Tomasz Torcz “(…) today's high-end is tomorrow's embedded
> processor.”
> tomek at pipebreaker.pl — Mitchell Blank on LKML
More information about the systemd-devel
mailing list