RetroFed Forums
Your home away from modern life.
Interesting systemd features you may not know about
Post Reply
AuthorMessage
codeinabox
programming.dev

codeinabox@programming.dev
Joined: 2025-09-29
Posted:   Subject: Interesting systemd features you may not know about Quote

18   Original
badmin
lemmy.today
badmin@lemmy.today
Joined: 2025-06-03
#2 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

More obvious, but systemd has a lot of features that a simple cron doesn't.

Which cron?

Oh wait. Why did I assume OP would know there are multiple implementations? πŸ˜„

17
0x0
infosec.pub
0x0@infosec.pub
Joined: 2024-05-20
#3 Posted: · edited   Subject: Re: Interesting systemd features you may not know about Quote Reply

More obvious, but systemd has a lot of features that a simple cron doesn't. Which cron? Oh wait. Why did I assume OP would know there are multiple implementations? πŸ˜„

You may have experienced this before. You have an agent write a script, perhaps to do some data analysis. It has a terrible memory leak, and suddenly your machine freezes and (hopefully) the kernel resumes after a bit with an OOM error I've had this a few times, and it's very annoying..

Holy fuck I can't stop laughing at their reason for systemd for some reason, probably need an agent summarising their article for me

19
badmin
lemmy.today
badmin@lemmy.today
Joined: 2025-06-03
#4 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

You may have experienced this before. You have an agent write a script, perhaps to do some data analysis. It has a terrible memory leak, and suddenly your machine freezes and (hopefully) the kernel resumes after a bit with an OOM error I've had this a few times, and it's very annoying.. Holy fuck I can't stop laughing at their reason for systemd for some reason, probably need an agent summarisi...

This has been happening forever. This old post always pops up in my mind for some reason as a historic example from an earlier linux boom.

Unfortunately, people have been pushed to not call out such things, because it's "not nice", when as the blog above shows, not calling it out is what's not nice, and potentially dangerous.

7
kibiz0r
midwest.social
kibiz0r@midwest.social
Joined: 2023-07-14
#5 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

You may have experienced this before. You have an agent write a script, perhaps to do some data analysis. It has a terrible memory leak, and suddenly your machine freezes and (hopefully) the kernel resumes after a bit with an OOM error I've had this a few times, and it's very annoying.. Holy fuck I can't stop laughing at their reason for systemd for some reason, probably need an agent summarisi...

I remember way back when I was doing Ruby on Rails, we would always wrap the server processes in a manager (I forgot what it’s called) that watches the memory and restarts them when the leaks get too bad. What a ridiculous solution that was.

5
Not a newt
piefed.ca
lemmyng@piefed.ca
Joined: 2025-06-07
#6 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

You may have experienced this before. You have an agent write a script, perhaps to do some data analysis. It has a terrible memory leak, and suddenly your machine freezes and (hopefully) the kernel resumes after a bit with an OOM error I've had this a few times, and it's very annoying.. Holy fuck I can't stop laughing at their reason for systemd for some reason, probably need an agent summarisi...

He also implies that cgroups are a systemd-only feature.

10
thingsiplay
lemmy.ml

thingsiplay@lemmy.ml
Joined: 2026-01-09
#7 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

Is there a way to limit download bandwidth of programs started with this systemd-run command? Without changing some network settings, I just want to do it temporarily on the fly with commandline options.

1
frongt
lemmy.zip
frongt@lemmy.zip
Joined: 2025-07-31
#8 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

This has been happening forever. This old post always pops up in my mind for some reason as a historic example from an earlier linux boom. Unfortunately, people have been pushed to not call out such things, because it's "not nice", when as the blog above shows, not calling it out is what's not nice, and potentially dangerous.

Yeah. I called out someone here on Lemmy for just completely making shit up about some kernel feature, linked the documentation showing the actual meaning, and got downvoted for it.

1
Magiilaro
feddit.org
DarkMetatron@feddit.org
Joined: 2024-06-24
#9 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

He also implies that cgroups are a systemd-only feature.

But to be fair, systemd makes using cgroups stupidly easy

2
Magiilaro
feddit.org
DarkMetatron@feddit.org
Joined: 2024-06-24
#10 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

Is there a way to limit download bandwidth of programs started with this systemd-run command? Without changing some network settings, I just want to do it temporarily on the fly with commandline options.

It is possible to limit the bandwidth for writing on the storage device with systemd-run, but not to limit the network bandwidth used by the programm (as far as I know)

The property for I/O bandwidth would be IOWriteBandwidthMax
https://www.man7.org/linux/man-pages/man5/systemd.resource-control.5.html

The commandline option to use it with is --property=
https://www.man7.org/linux/man-pages/man1/systemd-run.1.html

1
thingsiplay
lemmy.ml

thingsiplay@lemmy.ml
Joined: 2026-01-09
#11 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

It is possible to limit the bandwidth for writing on the storage device with systemd-run, but not to limit the network bandwidth used by the programm (as far as I know) The property for I/O bandwidth would be IOWriteBandwidthMax https://www.man7.org/linux/man-pages/man5/systemd.resource-control.5.html The commandline option to use it with is --property= https://www.man7.org/linux/man-pages/man1...

That's not the same as network bandwidth. Maybe I used the wrong terminology, I meant download speed, not max downloaded size of data contingent.

1
MonkderVierte
lemmy.zip
MonkderVierte@lemmy.zip
Joined: 2025-05-30
#12 Posted: · edited   Subject: Re: Interesting systemd features you may not know about Quote Reply

But to be fair, systemd makes using cgroups stupidly easy

I mean, the only thing i needed cgroups for was running rootless containers on Alpine (Openrc). This was something like cgroups = true in their main config. Can it be easier?

1
badmin
lemmy.today
badmin@lemmy.today
Joined: 2025-06-03
#13 Posted: · edited   Subject: Re: Interesting systemd features you may not know about Quote Reply

That's not the same as network bandwidth. Maybe I used the wrong terminology, I meant download speed, not max downloaded size of data contingent.

There is an ancient fully user-space simple tool called netbrake that works by LD_PRELOADING a library that overrides some functions like recv/sendto (similar to eatmydata's approach*). It may just work if you don't have special requirements. If you're curious, you can see the full list of overridden symbols with:

readelf -s /path/to/libnetbrake.so | grep -v UND

If you want a possibly fail-safe (kernel level) solution, you may find with a web search a helpful approach combining tc with cgroups.

Neither solutions need systemd.


* The realization that people growing up with SSD's probably never heard of eatmydata just sunk in.

2
Magiilaro
feddit.org
DarkMetatron@feddit.org
Joined: 2024-06-24
#14 Posted: · edited   Subject: Re: Interesting systemd features you may not know about Quote Reply

I mean, the only thing i needed cgroups for was running rootless containers on Alpine (Openrc). This was something like cgroups = true in their main config. Can it be easier?

Ok and now tell me how to use cgroups for a random binary, anything that has not buildin cgroups support.
That's were it gets complicated and where systemd can help a lot

You are using a tool where someone else has solved the hard part to show that no hard part exists in the first place.

1
thingsiplay
lemmy.ml

thingsiplay@lemmy.ml
Joined: 2026-01-09
#15 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

There is an ancient fully user-space simple tool called netbrake that works by LD_PRELOADING a library that overrides some functions like recv/sendto (similar to eatmydata's approach*). It may just work if you don't have special requirements. If you're curious, you can see the full list of overridden symbols with: readelf -s /path/to/libnetbrake.so | grep -v UND If you want a possibly fail-safe...

Thanks for the tip. I will look into it. My use case would be to limit download speed for applications that do not have such a setting (such as Firefox, just an example).

1
Magiilaro
feddit.org
DarkMetatron@feddit.org
Joined: 2024-06-24
#16 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

That's not the same as network bandwidth. Maybe I used the wrong terminology, I meant download speed, not max downloaded size of data contingent.

Yes and as I said there is no way to limit the network bandwidth, as far as I know, but limiting the speed that the tool can write to the storage device oftentimes limits the speed of retrieval also.

Kind of a indirect speed limit for the download, as a workaround.

2
badmin
lemmy.today
badmin@lemmy.today
Joined: 2025-06-03
#17 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

Thanks for the tip. I will look into it. My use case would be to limit download speed for applications that do not have such a setting (such as Firefox, just an example).

such as Firefox

You can use the cliget extension which generates full CLI commands for major CLI tools. Such tools have many options (e.g. curl's --rate-limit).

1
badmin
lemmy.today
badmin@lemmy.today
Joined: 2025-06-03
#18 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

Ok and now tell me how to use cgroups for a random binary, anything that has not buildin cgroups support. That's were it gets complicated and where systemd can help a lot You are using a tool where someone else has solved the hard part to show that no hard part exists in the first place.

what is cgexec πŸ€”

1
Magiilaro
feddit.org
DarkMetatron@feddit.org
Joined: 2024-06-24
#19 Posted: · edited   Subject: Re: Interesting systemd features you may not know about Quote Reply

what is cgexec πŸ€”

Yes, that is one of the tools needed.
But it is not helping with doing anything meaningful with cgroups.
A cgroup without any kind of specific configuration is almost as good as no cgroup at all.
That's what I meant with the hard part.

And I did say that systemd makes it stupidly easy, in contrast to the normal easy that cgroups often are.

1
thingsiplay
lemmy.ml

thingsiplay@lemmy.ml
Joined: 2026-01-09
#20 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

Yes and as I said there is no way to limit the network bandwidth, as far as I know, but limiting the speed that the tool can write to the storage device oftentimes limits the speed of retrieval also. Kind of a indirect speed limit for the download, as a workaround.

Ah, I didn't pick up on that. Well, need to test this out. As a workaround it could work. I don't have any other special requirements for this, its really a workaround in itself for tools that don't have this setting. (which annoys me alot) Nice idea btw.

2
thingsiplay
lemmy.ml

thingsiplay@lemmy.ml
Joined: 2026-01-09
#21 Posted:   Subject: Re: Interesting systemd features you may not know about Quote Reply

such as Firefox You can use the cliget extension which generates full CLI commands for major CLI tools. Such tools have many options (e.g. curl's --rate-limit).

Firefox was just one example of tool that doesn't provide a limit by itself. I'm looking for a solution that could be applied to any program.

1
Post Reply Page 1