Re: [systemd-devel] Q: Change a kernel setting

2022-07-29 Thread Tomasz Torcz
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


-- 
Tomasz Torcz   “(…) today's high-end is tomorrow's embedded processor.”
to...@pipebreaker.pl  — Mitchell Blank on LKML



[systemd-devel] Q: Change a kernel setting

2022-07-28 Thread Ulrich Windl
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?

Regards,
Ulrich