Hacker News new | ask | show | jobs
by js2 858 days ago
systemd is is many things, but obvious and accessible is not one of them. It has a lot of power and flexibility, but the trade off is a lot of complexity. Just look at the unit configuration file:

https://www.freedesktop.org/software/systemd/man/latest/syst...

I've never heard of a systemd timer before, but I guessed it was a type of unit file, so I just read the documentation:

https://www.freedesktop.org/software/systemd/man/latest/syst...

I have no idea from that documentation how I'd run something every hour. I guess I have to create a new unit file, and use the OnCalendar stanza? But what do I set it to? I'm directed to this page:

https://www.freedesktop.org/software/systemd/man/latest/syst...

Oh, I see I can use "hourly" but it turns out that's syntactic sugar for:

  *-*-* *:00:00
Is that really any easier than the cron equivalent?

  0 * * * *
Which can also be written (on FreeBSD) as:

  @hourly
https://man.freebsd.org/cgi/man.cgi?query=crontab&sektion=5&...

I started my career as a Unix SA over 25 years ago and have worked with a lot of different Unix-flavored operating systems: SunOS/Solaris, HP/UX, FreeBSD, Linux (Slackware, RedHat, Debian), macOS/OS X, AIX. I'm familiar with all their different variations of init.

All of them are esoteric in one way or another. Some of them have their behavior right out in the open where it's easy to see (inittab and rc scripts). Others hide away massive complexity (launchd and systemd) and require extensive documentation to understand.

I appreciate all the power that systemd provides. It gets a lot of things right. But in terms of complexity, it's almost an operating system unto itself.

1 comments

I'm not quite sure why you felt pressed to write this long-winded response to something I didn't write. I never said that systemd is easy. I said that if someone is running *BSD, today, in 2024, they'll cope with cron's syntax.

I'll still reply to one part:

> Oh, I see I can use "hourly" but it turns out that's syntactic sugar for:

> *-*-* *:00:00

>Is that really any easier than the cron equivalent?

> 0 * * * *

...Yes? Ask someone who's not familiar either with cron or systemd to guess what each one mean, with the context that it's supposed to be something related to dates and times. If you're vaguely familiar with how dates are usually written down, and that a star is a wildcard, you can immediately guess that the first one means "any year, any month, any day, any hour, at the first minute, first second". The cron one? It's anyone's guess.

Hah, that's fair. I inferred from your comment the corollary that systemd is not arcane, and thought "oh, it's just arcane differently," hence my long-winded reply.