This plays some kind of role in the debate of systemd being good or not. I’m not sure if goes in the good column or the bad column, but I know it goes into a column.
I am typically in the group saying “systemd is overlarge with too many responsibilities” but this capability makes perfect sense for its job running services. Probably the good column.
This kinda functionality is surprisingly apropos to a problem I have a work, I realize. And yet, I have k8s. More and more I am appreciating the niche systemd can play with pets instead of cattle and wished corps weren’t jumping to managed k8s and all of that complexity it entails immediately.
You can run systemd (or cron) inside a pod for scheduling and call the kubernetes API from there to run jobs and stuff. Not sure if this helps you, but it can be easy to overlook.
haha, yeah I am well aware I could do something like that. Unfortunately, once you start working for larger companies, your options for solutions to problems typically shrink dramatically and also need to fit into neat little boxes that someone else already drew. And our environment rules are so draconian, that we cannot use k8s to its fullest anyhow. Most of the people I work with have never actually touched k8s, much less any kind of server oriented UNIX. Thanks for the advice though.
I think it depends which side of the debate one is on?
me: systemd is not that bloated
systemd:
Try scheduling a cron tab job to run a task on dates defined that way.
But that’s not what I need and the world revolves around me…
You need a calendar and time handling anyways for logging purposes and to set timers correctly. It’s likely not that much extra work exposing that functionality.
No, UNIX philosophy demands that every single one of those things is one or more separate things and that half of them are poorly or not at all maintained. Just like God intended.
Finding the next super holiday is a core system feature I could survive without. 🎉
Well, date time stuff for a system working with timers and scheduling actions might be pretty useful…
That’s not what it’s there for. It can also be used that way.
I think this is for setting date oriented timers
Systemd. A tool created in search of problem.
The problem: incomprehensible init scripts
The solution is learn them.
Ahh, you made my day!
systemd is the future, and the future has been here for over a decade and yet old Unix and BSD purists still cry about it
I have one simple thing to say to the downvoters: I am not using a minicomputer from 1970, why should I be bound by the limits set then?
Yeah, I’m also one of these people silently enjoying systemd and wayland. Every now and then there’s fuzz on one of these. I shrug, and move on still enjoying both of them.
They are also still complaining about PulseAudio, despite Pipewire having mostly replaced it, while spending hours fiddling with ALSA to use their headphones.
I wouldn’t cry about it if it wasn’t so God awful to work with
In what way?
I’ve felt like systemd has been a breeze compared to the hodgepodge of different stuff that preceded it. Now most distros have it mostly the same way, tools are well documented, things works together. It wasn’t always like that from what I remember
In the UK, if Christmas or New Year falls on a weekend, a seperate equivalent holiday is made during the week to compensate.
This is true for all public holidays in the UK, there’s a (usually) fixed number of public holidays but the dates are flexible.
They’re also included in the minimum 28 days paid time off too, meaning if you’re a full time worker and have to work on a bank holiday your employer is legally required to offer an extra day off somewhere else instead, either a fixed date or added to your holiday allowance. Conversely, the “extra” day off you get when a monarch keels over may be subtracted from your holiday allowance for the year. This is also why my employer is allowed to follow English bank holidays despite having next to no presence in England; the number is fixed but the dates are not.
but the UK has the fewest public holidays in Europe. In Germany we have 9-13 but don’t get a day off if a public holiday is on a weekend. And we have a minimum of 20/24 days of holiday on top
Same for lots of jobs here.
Honestly, Wednesday and Thursday are the worst days for Christmas for those of us who also get Christmas Eve because they’re the only days that don’t result in 4 days in a row off from work.
If it’s on a Friday, we get Thursday through Saturday. If it’s on a Saturday, Sunday, or Monday, they give us Friday through Monday, and if it’s on a Tuesday, they give us Saturday through Tuesday.
But this year, we’re off Saturday and Sunday, work Monday, are off Tuesday and Wednesday, and return to work on Thursday.
It’s the same total number of days off, but it’s way less useful - especially if travel is involved.
Wait, do other countries not do this? So if a public holiday falls on a Saturday it doesn’t get pushed to Monday?
Don’t do that in Norway either - just bad luck if the holidays happen to land on a weekend. On the other hand, we have five weeks of paid vacation, and holidays are not counted into those, I’m not sure how that’s done in other countries?
Germany doesn’t do this, but the minimum, when all holidays fall on the worst possible days, is more than the number of holidays in the UK.
Netherlands doesn’t do this, and we have less holidays then UK haha
So even when you lose you win.
Awesome!
Too bad about its failure as an init system, though.
This just like Emacs all over again!
No, emacs is superior
What, Emacs is a successful init system https://github.com/a-schaefers/systemE
No, nobody forces you to use emacs at gunpoint.
Whoever forced you? distros wanting a stable system?
Some emacs evangelicals would like to.
You must be either the very old get off my lawn type or very young and edgy. Everyone else in between likes systemd, one of the best things that happened to GNU/Linux in a while.
If by failure you mean every system under the sun using it
I don’t think they are using popularity as a metric. But I think the functionality of it is also very good, so dunno what their gripe is.
Oh fuck. I’ll use this from now on. Except for if I won’t use it next week. Then I’ll forget about it because my memory is a damn sieve.
Use a systemd timer to send yourself a reminder. Discoverd them recently myself and honestly liking them more than cron.
Just take the next step and make a text file you dump all these commands into and then forget about in a week. When you randomly stumble across it years from now you’ll be able to say “wow, I could have used this 10 months ago if I remembered it existed!”
I make a separate text file per command so I can search them!
Which I dont.
We can store those text files in a terminal and search for them from the command line with man command!
I usually print these out and put them in a safe deposit box at a bank so I never lose them
I keep a persistent “sticky note” (in KDE) drop down on my top bar where I copy/paste important commands, scripts, etc.
I actually remember to use it sometimes.
I feel you. It’s however gotten a lot better since I turned some of these commands into abbreviations. They’re aliases that expands in place, more or less. Fish has them natively, I personally use zsh-abbr.
Fish is super useful, but I usually only start it up if I’m having trouble finding or remembering a command.
Yeah, it’s a good shell. I’ve found the lack of compatibility with some bash tools to be inconvenient enough that I just went back to zsh and found alternatives for the parts that I liked about it. Works well enough for me.
I’m relatively new to Linux in general (have only been on it for about a year and a half, but have taken to it like a fish to water), so forgive me if this is a dumb question, but what are some benefits to using zsh over bash? Are there any cons?
Thanks! I hate this. 🖤
That’s pretty clever.
Damn and does it work as an init too? xD.
$ systemd-analyze calendar tomorrow Failed to parse calendar specification 'tomorrow': Invalid argument Hint: this expression is a valid timestamp. Use 'systemd-analyze timestamp "tomorrow"' instead? $ systemd-analyze timestamp tuesday Failed to parse "tuesday": Invalid argument Hint: this expression is a valid calendar specification. Use 'systemd-analyze calendar "tuesday"' instead?
ಠ_ಠ
$ for day in Mon Tue Wed Thu Fri Sat Sun; do TZ=UTC systemd-analyze calendar "$day 02-29"|tail -2; done Next elapse: Mon 2044-02-29 00:00:00 UTC From now: 19 years 4 months left Next elapse: Tue 2028-02-29 00:00:00 UTC From now: 3 years 4 months left Next elapse: Wed 2040-02-29 00:00:00 UTC From now: 15 years 4 months left Next elapse: Thu 2052-02-29 00:00:00 UTC From now: 27 years 4 months left Next elapse: Fri 2036-02-29 00:00:00 UTC From now: 11 years 4 months left Next elapse: Sat 2048-02-29 00:00:00 UTC From now: 23 years 4 months left Next elapse: Sun 2032-02-29 00:00:00 UTC From now: 7 years 4 months left
(It checks out.)
Surprisingly its calendar specification parser actually allows for 31 days in every month:
$ TZ=UTC systemd-analyze calendar '02-29' && echo OK || echo not OK Original form: 02-29 Normalized form: *-02-29 00:00:00 Next elapse: Tue 2028-02-29 00:00:00 UTC From now: 3 years 4 months left OK $ TZ=UTC systemd-analyze calendar '02-30' && echo OK || echo not OK Original form: 02-30 Normalized form: *-02-30 00:00:00 Next elapse: never OK $ TZ=UTC systemd-analyze calendar '02-31' && echo OK || echo not OK Original form: 02-31 Normalized form: *-02-31 00:00:00 Next elapse: never OK $ TZ=UTC systemd-analyze calendar '02-32' && echo OK || echo not OK Failed to parse calendar specification '02-32': Invalid argument not OK
Just write your own initialization system in bash. It is more reliable and less bloated.
Okay this is cool and all, but why would systemd have a calendar?
(also how do i do this)
As others have said on this thread, it’s because systemd has fairly advanced timer system that basically requires implementing a calendar.
To do it, the command is in the screenshot
systemd-analyze calendar "Tue *-12-25"
.
How is Tuesday Christmas optimal?
I guess that makes a long weekend with Christmas Eve and then Christmas?
Is Friday Christmas just as good?
Seems like it would be, maybe OP has more reasons to think why Tuesday is more optimal.
Not in Germany, where 25th and 26th are bank holidays. So having these close to the prior or following weekend makes for four days off
Students here usually get Mondays off when the next Tuesday is a holiday. As a university sysadmin, I cherish those days because that’s when we can get actual work done without having to work around the chaotic classroom reservations or work in ten-minute bursts during breaks. It’s also when we can implement changes to the network and update the servers because the office workers don’t tend to come in.
The last time that happened, all of us sysadmins did about three months’ worth of actual work in a few hours, then used the smaller lecture hall as a cinema for the rest of the day.
I suppose for people in the office, it means everyone else has fucked off and the week is basically a wash.