Top
Best
New

Posted by yacin 9 hours ago

Love systemd timers(blog.tjll.net)
250 points | 169 commentspage 3
louiskottmann 2 hours ago|
And you immediately lose the ability to do `crontab -l` on any server to know its scheduled tasks.

Now you get to look around the myriad of places where you can put systemd files, and figure out which ones are base services and which ones are custom, with no general convention to go about it. Nope.

TazeTSchnitzel 2 hours ago||
If you had read the article, you would have seen its answer to this.
arter45 2 hours ago||
systemd list-timers

With —-all

cmsj 5 hours ago||
Is there a way yet to force-trigger a timer? There wasn't the last time I used them, which I found to be super annoying for testing them.
Biganon 4 hours ago|
It's covered in the article, you can simply start the unit that would be started by the timer.

Oh but it won't appear in the timer-specific logs, I guess...

MarkusWandel 3 hours ago||
Does systemd ship with something to upgrade your cron jobs for you? That would be the friendly way. Write your old school cron jobs, and then a script that converts them to do things the systemd way, documenting its steps, i.e. I created this file and this is why. Friendly "I help you do things better" rather than standoffish "your way is obsolete, you need to do it our way". Oh wait. I get it. LLM agents can do exactly that for you can't they. Another way I'm behind the curve.

I have knocked together a systemd service or three based on google copypasta. But generally, for cron jobs, why make it complicated? One line in /etc/crontab and done. I generally call an encapsulation script that sets the right environment variables, uses absolute paths, captures stdout/stderr if required and so on. I just want the simplest possible way to launch that script on a schedule.

bigbuppo 3 hours ago||
That would assume I like systemd in the first place.
encoderer 2 hours ago||
I setup a few systemd timers last year and created https://systemd.guru to play with different options in OnCalendar expressions.
pull_my_finger 4 hours ago||
I'm fully ready to drink the "just let systemd do all the things" kool-aid, but I would love to see some sort of introductory/tutorial info into some of the things it can do other than services - i.e. containers and timers. I know man pages exist, but it would be nice if there was more scannable intro out there.
htx80nerd 4 hours ago|
btw that xz hack only effect systemd distros
andrewstuart 6 hours ago||
Even better is systemd socket activation.
wmanley 5 hours ago||
I design all my services expecting to receive sockets this way. It makes sandboxing easy as the service itself doesn't need network access to have a listening socket.

It's a shame docker never supported it. I feel like if they had got on board all those years ago there would be broad support across the software ecosystem for it and we wouldn't need half of these complicated iptables rules and proxies and service mesh. It would be a step towards a capability based system.

interf4ce 6 hours ago||
This is very interesting. I'm not sure what I'd use it for yet, but I imagine it could be useful for triggering ad hoc jobs over the network. Maybe have Home Assistant make a network call to kick off a daily back up when I leave the office at the end of a work day.
kevinmgranger 6 hours ago||
I believe its original motivation was just speeding up boot times by starting fewer services, even if you'd eventually want the service running. This was achieved in the past with xinetd, but systemd made the approach more popular for the masses.
roryirvine 4 hours ago||
inetd began to fall out of favour in the mid-late 90s as services became more heavyweight and startup times became longer (think of the initial crypto setup needed by sshd vs rsh/telnetd)

CPU speeds have increased & and i/o latency has decreased so much since then that startup times are generally imperceptible, so the pendulum has swung back to favouring socket activation.

The anti-systemd "traditionalists" never seem to acknowledge that history, though!

mkesper 4 hours ago||
There's another big feature: You're not relying on the time zone to which the server was set (like with cron) but can explicitly specify a time zone:

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

6031769 3 hours ago|
Of course you can do this trivially in cron as well. It is what the CRON_TZ variable is for.
mkesper 3 hours ago||
This is a GNU extension so not portable.
simoncion 2 hours ago||
> This is a GNU extension so not portable.

1) It's supported by cronie. I bet it's supported by many other crons.

2) "Great" news! The software in the Systemd Project only officially runs on Linux, so "it's not portable" is a really bad counterargument when "alternatives to some Systemd Project feature" is the discussion topic.

dmuth 3 hours ago||
> stdout and stderr output often ends up in a black hole

Ain't that the truth. Literally every crontab I've written for the last 10 years has had this in it:

2>&1 | logger -t cron-WHATEVER

...and that does a pretty good job of capturing anything that the script emits and making it easy to grep for in syslog the following morning.

But I'm still amazed at how many crontabs I run across that don't capture any output at all.

More comments...