Live data from Hacker News

Love systemd timers

blog.tjll.net

211–220 of 309 posts

Re: Love systemd timers

#211

Earlier quoted context omitted.

Having had to work on an application supposedly supporting cron expressions: the numbers are just the basic parts of the language. When someone inputs something ridiculous like "5,3/4 4-8,11 1 4,5,6,9-11 */2" you get to enjoy the fun of reverse engineering what they meant (it's never what they actually wrote). And that's before you get to all the extensions supported in some cron environments (but not all). I find sy…

Per other comments though, it looks like systemd's syntax when you want to specify something that's not just that one number is at least as complex. Is your example (which I agree, looks cryptic) any less cryptic in systemd? I asked jippity, and it said this: [Timer] OnCalendar=*-04,05,06,09,10,11-01 04..08,11:03/4,05:00 OnCalendar=Sun,Tue,Thu,Sat *-04,05,06,09,10,11-* 04..08,11:03/4,05:00 To which I have to go: "wha…

This is like a complaint about regex syntax. It's impossible to comprehend a non-trivial regex in a second or two. However, if you know the rules, it's trivial to step through it. What's the point of complaining? There's no representation that anyone could grok on first impression. This is much simpler than regex.

Nobody's prevented from using cron instead of systemd timers. The significant differences in typical relatively simple cases are ordering:

cron: M H d m Y DOW

systemd: DOW Y-m-d H:M:S [each part optional, with *, *, and 00:00:00 defaults]

And then, because - is taken, ranges use .. in systemd. Aside from that, it's mostly the same for typical cases of simple periodic timers. Even x/n and x-y/n for steps work similarly. Syntax for complex cases start to diverge, for jitter or special numerically-irregular DOW or DOM or multiple non-periodic times.

In your example, adding more spaces between the date and time parts would make it more visually digestible. There's also the .. range operator which jippity strangely didn't use for the month field even though it did for the hours field.

Re: Love systemd timers

#212
post #149

It may be a disastrous comment to make but I think I like cron better! A tool designed for a particular job etc.... :/

I designed a tool for flying. It's only designed for flying. It is based on the principles of the brick.

Re: Love systemd timers

#213

systemd is complex on first view, but after using it you didn't want to use anything else. It's handy to manage everything using systemctl

This is such a modern view. People used to HATE systemd when it first came out, but I always liked it and knew people would eventually come around and its nice to see they finally did!

People still hate systemd

First it caused lots of issues. And didn't deliver anything significant

But the biggest issue has always been architectural, the way systemd keeps absorbing existing projects, and functionality. That keep adding to the more than 1 million lines of C monolith, that can burden progress in the futre

But as long people can replace any of systemd tool, for a tool they like better, all good

Personally I am now using desktop/server distros without systemd, and there is nothing that I miss, everything works... cuda/llama.cpp/steam/docker...

And commands always have to google them anyway, or find in history...

Re: Love systemd timers

#214

Earlier quoted context omitted.

> I've used Linux since 1994 Same here. We are now considered old and therefore irrelevant. The new generation uses timers and couldn't care less about cron that has served us just fine for decades. I use cron and my general attitude towards LP and systemd is very similar to the attitude of LP and systemd to us.

Total n00b here. My first linux install was pretty recently, in late 1996 or early 1997 (sometime that winter). I just don't get it. Like is the core sentiment "How dare they address obvious system shortcomings"? Is it "I learned once and how dare you think I'm capable of learning again"? Is it "I want others to suffer the way I did to learn job scheduling"? cron did a job, but had shortcomings. Systemd addresses man…

Yeah, I certainly have my complaints about systemd but the parent's point is undermined by the fact that cron still works. If you prefer it, carry on I doubt seriously it's going anywhere. I still do sometimes.

Re: Love systemd timers

#215
post #181
post #174

Earlier quoted context omitted.

is this irony?

No. Is that not readable to you lol? I think anyone with even a passing familiarity with systemd would understand what that chunk of Nix is doing. Compare it to the alternative of using plain systemd (including command(s) required to enable units). Also, consider what build-time validation you get prior to starting the unit/timer. Hint: zero.

It's significantly uglier and it also skips the helpful headers / sections in the systemd INI files. `[Unit]` and `[Service]` and `[Timer]` represent different layers of execution. Many Nix people got used to the horrible syntax of Nix, I guess? I still find Bitbake significantly more palatable than Nix.

I do appreciate build-time checking but I think this can be solved at systemd side as a separate tool just as effectively.

Re: Love systemd timers

#216
post #25

NixOS comes with systemd, so I've been using it as a first-class part of managing stuff. It's great, especially coming from macOS' launchd. Which makes it nice to distribute a tool for NixOS so that it can lean into systemd instead of as some bolted-on afterthought. Makes me wonder what you'd do if you were distributing a lifecycle-heavy tool for Linux users in general since systemd isn't ubiquitous. I use a systemd…

+1, NixOS makes working with systemd a breeze. Defining units in Nix beats wrangling INI files. systemd.services.sync-recyclarr = { serviceConfig.Type = "oneshot"; path = [ pkgs.podman ]; script = '' podman exec -it recyclarr recyclarr sync radarr podman exec -it recyclarr recyclarr sync sonarr ''; }; systemd.timers.sync-recyclarr = { timerConfig = { OnCalendar = "daily"; Persistent = true; Unit = "sync-recyclarr.ser…

I don't currently have a personal use-case for container services, but Quadlets are another example of systemd (and podman) beauty. It looks like someone has gone through the trouble of making the OS+home-manager modules: https://github.com/SEIAROTg/quadlet-nix

Re: Love systemd timers

#217
post #2

I've been almost convinced by systemd (and have switched to using it), but God the syntax of those service files is so ugly ...

There's definitely some weirdness to certain parts of systemd service files, but was a huge improvement over Upstart and the old SysV-style init scripts. Over all I think Systemd get way to much criticism. You don't have to use all the parts, but if you care to go through the documentation you'll find interesting features such as journald log-shipping and systemd-machined which can manage containers and VMs.

I love how easy it is to create a completely isolated daemons with systemd. In a single .service file one can define a daemon that has a very limited view to the filesystem, can only open specific devices, uses randomized UIDs, and has limited capabilities: https://www.freedesktop.org/software/systemd/man/latest/syst...

It is way simpler and cleaner than Docker/Podman IMHO.

Re: Love systemd timers

#219
post #215
post #181

Earlier quoted context omitted.

No. Is that not readable to you lol? I think anyone with even a passing familiarity with systemd would understand what that chunk of Nix is doing. Compare it to the alternative of using plain systemd (including command(s) required to enable units). Also, consider what build-time validation you get prior to starting the unit/timer. Hint: zero.

It's significantly uglier and it also skips the helpful headers / sections in the systemd INI files. `[Unit]` and `[Service]` and `[Timer]` represent different layers of execution. Many Nix people got used to the horrible syntax of Nix, I guess? I still find Bitbake significantly more palatable than Nix. I do appreciate build-time checking but I think this can be solved at systemd side as a separate tool just as effe…

Ugliness is subjective :)

But my question was around readability: were you able to understand what the snippet I shared is doing?

Re: build-time checks - but systemd hasn’t done it, and I am also unsure where exactly this verification would even take place given systemd’s configuration model. Unless you’re talking about some kind of language server or IDE integration.

Re: Love systemd timers

#220
post #187

Earlier quoted context omitted.

TIL that's the standard US pronunciation. I thought you must be joking, referencing something else: OP's title works with BrE pronunciation at least. https://en.wiktionary.org/wiki/primer#Pronunciation

Wait, really? I'm a native Midwestern/Great Plains American English speaker (I remember reading the Harry Potter books as a kid and wondering why all the -er words were spelled wrong) and I say "PRY-mer." I have never heard anyone say "PRIM-mer" in my life. Am...am I being punk'd...?

I am too. I've heard of the supposedly correct pronunciation, but I can't bring myself to use it. The "PRY-mer" pronunciation is more common in practice.
Post reply on HN