Earlier quoted context omitted.
>`cron` works best if you desire simplicity above all else It may be simple, but it's config file is hard to comprehend compared to a systemd timer. Being able to just use "Friday 17:00" or "hourly" is so much more readable.
While I support systemd timers over cron, AFAIK cron has stuff like @hourly.
Systemd by Example (2021)
41–50 of 115 posts
Re: Systemd by Example (2021)
#42Earlier quoted context omitted.
>`cron` works best if you desire simplicity above all else It may be simple, but it's config file is hard to comprehend compared to a systemd timer. Being able to just use "Friday 17:00" or "hourly" is so much more readable.
I started writing a "oh, I never found it that difficult" comment. Then I thought to test my own belief and tried to type out a cron schedule for "run this every hour", and... Well... https://crontab.guru/#*_0/1_*_*_ * Oops. Point taken :)
0 * * * * this
Adjust the leading digit to whichever minute of the hour you wish to run this.Re: Systemd by Example (2021)
#43And yet I do the _exact_ same thing with systemd. I don't get it, I don't like it, and every time I need to do _anything_, I'm googling, copy pasting commands into my terminal until something vaguely correct happens. The CLI options are indecipherable to me, like reading hieroglyphics.
Deep down I understand that it solves some pretty complex things when it comes to system initialization, but something about the UX of using journalctl and systemctl is so bad (for me) that it creates a mental block that I cannot overcome.
Luckily, nothing I do in my day job requires messing with systemd.
Re: Systemd by Example (2021)
#44Earlier quoted context omitted.
>`cron` works best if you desire simplicity above all else It may be simple, but it's config file is hard to comprehend compared to a systemd timer. Being able to just use "Friday 17:00" or "hourly" is so much more readable.
I started writing a "oh, I never found it that difficult" comment. Then I thought to test my own belief and tried to type out a cron schedule for "run this every hour", and... Well... https://crontab.guru/#*_0/1_*_*_ * Oops. Point taken :)
Re: Systemd by Example (2021)
#45Earlier quoted context omitted.
Not a lot of people, a very loud minority. They can go use Void Linux or other niche distros which replace it with the monstrosity that were SysV init scripts. It's the type of people that never had to write one of those scripts by hand, and maybe support two or three different distros. The UX of systemd tools (systemctl, journalctl) is a bit crap, to be honest, but systemd does what it needs to do well and it is an…
That's serveral conjectures on your part. Give me metrics about the minority and then back up the fact that most of those people never wrote a sysinit or rc script by hand. Like it or not Systemd breaks the Unix way and for a certain amount of people (I am not pretending to have a measuring stick) the dogma and philosophy are much more important than perceived ease of use or features.
A conjecture is not automatically wrong. The point of a conjecture is to challenge someone else to prove it wrong. You'd have a hard time showing proof that systemd is niche.
And honestly, it does not break UNIX, let's be serious now. A haphazard bunch of shell scripts is not much better than a monolithic binary, and UNIX does not give a damn either way.
I do not care about dogma and philosophy, I am an engineer with software to run and deadlines to meet.
Re: Systemd by Example (2021)
#46Ha, systemd is basically my git. I'm always surprised by how many developers don't grok git despite understanding significantly more complex things. I keep thinking if they would just take a day or two, they would get it and then wouldn't complain about having to copy paste commands and "rm -rf && git clone" to fix their workspaces. And yet I do the _exact_ same thing with systemd. I don't get it, I don't like it, an…
Re: Systemd by Example (2021)
#47Earlier quoted context omitted.
> There's a single implementation as far as I know That's exactly what I mean. Systemd itself, including timers, is deeply coupled with the Linux API, and cannot be (easily) ported on any other system. Cron, on the other hand, exists on almost every UNIX-like system.
I'm sure the few people who run BSD systems will be fine with cron's arcane syntax.
You can argue that no other system matters (which I strongly disagree with for reasons I don't want to get into right now), but that doesn't make systemd timers any more portable.
Re: Systemd by Example (2021)
#48I wish I could make friends with systemd like y'all. I spent at least a week wrestling unsuccessfully with systemd (admittedly starting from complete ignorance) to make a service that synchronizes a local directory on a laptop with a remote directory on a server after a docker container is stopped but before the filesystems and network stack are torn down during poweroff. It was easy enough to accomplish by manually…
Naively, I'd expect `ExecStop=` to just work™. Is this not the case?
Re: Systemd by Example (2021)
#49Earlier quoted context omitted.
> There's a single implementation as far as I know That's exactly what I mean. Systemd itself, including timers, is deeply coupled with the Linux API, and cannot be (easily) ported on any other system. Cron, on the other hand, exists on almost every UNIX-like system.
I'm sure the few people who run BSD systems will be fine with cron's arcane syntax.
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.
Re: Systemd by Example (2021)
#50Systemd is one of the things that is really enhanced by ChatGPT. “Write me a service to start this program” Or “Write a socket activated service to…..” Or “Write a systemd timer that runs every ten minutes” Etc etc