|
I once wrote a script that created/started/stopped a user-service in systemd. It was… fine? I definitely encountered more bullshit using other systems. I am not a sysadmin though.
|
# ? May 19, 2024 03:43 |
|
|
# ? Jun 10, 2024 11:16 |
|
Systemd was much easier for me to run a daemon than any other thing I had used in the past. It’s Fine™
|
# ? May 19, 2024 03:52 |
|
pseudorandom name posted:He's not a douche, he's German. he is absolutely both
|
# ? May 19, 2024 04:06 |
|
systemd makes more things declarative and subject to mechanical analysis, and given the complexity of service lifecycles on a modern Linux that’s pretty critical for making things even halfway comprehensible but you do have to actually learn it, instead of just making a file under /etc with the same commands you used to start the thing manually and the name “quadlet”…
|
# ? May 19, 2024 04:08 |
|
Subjunctive posted:and the name “quadlet”… It's a stupid Kubernetes pun but at least it googles well I guess. Unlike say the "ip" command.
|
# ? May 19, 2024 04:10 |
|
xzzy posted:It's a stupid Kubernetes pun but at least it googles well I guess. *googled well Google has gone to poo poo and nothing googles well anymore.
|
# ? May 19, 2024 08:25 |
|
Framboise posted:As a newer Linux user: is systemd really that bad? Normal people do not think about or care about the init system that's in use on their system. I don't even understand the complaints about Systemd, that it does a lot of separate things rather than one single thing? That is 'bloat'? A lot of people bitch about Wayland too, but there's probably good reason for that if it just doesn't work properly for their specific use case.
|
# ? May 19, 2024 08:36 |
|
Inceltown posted:*googled well I have been trying to un-Google myself all year and while I've switched from Chrome to Firefox and set my search settings to DuckDuckGo, I feel like it's pretty inescapable so long as I'm still using an Android phone and use a gmail account (and I don't have the nerve to make a new email address since I've been using this one since like 2007). Can't stand iPhone's interface though, so whatyagonnado. Thankfully, un-Microsofting will be much easier once I can move over to Linux. My issue's more with my PC than my willingness or ability to do so though. keep punching joe posted:Normal people do not think about or care about the init system that's in use on their system. I don't even understand the complaints about Systemd, that it does a lot of separate things rather than one single thing? That is 'bloat'? Yeah, that was my understanding of it before asking here earlier, "it handles a bunch of things instead of just one". Like I get the idea of minimalism and having a program do one thing real good being ideal and stuff, but I dunno, having a program that's able to handle many things sounds efficient to me? Framboise fucked around with this message at 08:39 on May 19, 2024 |
# ? May 19, 2024 08:37 |
|
I do think that the only legitimate complaint is that systemd's documentation sucks. Most other complaints are mostly people complaining about learning new things and making excuses. Though I feel like there is a gap where Systemd is an improvement for developers and casual users, but it is equal or worse for amateur tinkerers. For example if you want to make a minor modification to a script in your system-v the automation is written in bash just like your script and you open the file and change that one line. Which breaks easily. For systemd you have to create an overwrite file and write it from scratch using a syntax that you don't know and that has its documentation spread over a dozen help files. And you still need to learn bash for the actual script. Now these days there is a overwrite file editor that shows you the defaults as comments, making that editing much easier. But, it didn't exist in the beginning. And as the most accessible source for systemd syntax are random outdated answers on stackexchange, you might not even know about the feature. Also people do tell you to write unit files. Just complain about anything related to cron, and people will tell you to "just" write a timer file and an unit file from scratch instead of changing a config options in cron.
|
# ? May 19, 2024 09:14 |
|
The Unix philosophy is a program should do one thing and do it well. Systemd does one thing and does it well. It manages the system. Perfectly compliant with unix philosophy. VictualSquid posted:Though I feel like there is a gap where Systemd is an improvement for developers and casual users, but it is equal or worse for amateur tinkerers. Maybe, but also the whole drop-in configs is a systemd thing isn't it? Being able to manage /etc by adding 69-myconfig.conf as an isolated and unique file is really nice for the intro-level tinker. It makes the changes you've done to the system almost self-documenting. (And very easy to back up if you use a particular prefix for your own configs.) VictualSquid posted:Also people do tell you to write unit files. Just complain about anything related to cron, and people will tell you to "just" write a timer file and an unit file from scratch instead of changing a config options in cron. So as someone who was new to all of this, I didn't see much difference in complexity between making a systemd timer and cron. They both have some different pros and cons. Systemd timers are not that hard. You just know cron already. But yeah the official documentation sucks.
|
# ? May 19, 2024 13:52 |
|
Klyith posted:Maybe, but also the whole drop-in configs is a systemd thing isn't it? Being able to manage /etc by adding 69-myconfig.conf as an isolated and unique file is really nice for the intro-level tinker. It makes the changes you've done to the system almost self-documenting. (And very easy to back up if you use a particular prefix for your own configs.) I think the drop-in configs started with udev, before systemd. Or possibly were backported to system-v, because they are a good idea. I personally found them harder to get into, because you start with an empty file instead of changing an already existing config line which feel like more mental effort to me. Which is why I think that systemd's biggest improvement was pre-populating drop-in files. And I think that they added that only after the peak of complaining prolonged the complaining massively.
|
# ? May 19, 2024 14:01 |
|
VictualSquid posted:I think the drop-in configs started with udev, before systemd. Or possibly were backported to system-v, because they are a good idea. Drop-in configs were a thing for Apache before udev existed, IIRC.
|
# ? May 19, 2024 14:06 |
|
VictualSquid posted:Also people do tell you to write unit files. Just complain about anything related to cron, and people will tell you to "just" write a timer file and an unit file from scratch instead of changing a config options in cron.
|
# ? May 19, 2024 14:14 |
|
mystes posted:Cron is the worst thing ever created Just write a timer file and an unit file from scratch instead of changing a config options in cron.
|
# ? May 19, 2024 15:15 |
|
but you don’t have to do that, because the tools generate pretty much all of it and there’s an LSP it’s not like cron fuckups taking out a service is even uncommon today, but especially before crond grew jitter and such
|
# ? May 19, 2024 15:25 |
|
Subjunctive posted:but you don’t have to do that, because the tools generate pretty much all of it and there’s an LSP Which tools? And what is an LSP? And that brings us back to the fact that the big legitimate complaint about systemd is it's terrible documentation.
|
# ? May 19, 2024 15:27 |
|
"write a config from scratch" makes it sound really hard when all you are doing is copy-pasting ~13 lines of text, if you are making something with the same level of capability as cron.code:
code:
Note that you can have multiple OnCalendar lines, which makes complicated timers way easier than cron. Though I've heard that cron can do times that systemd can't, if you want some real phase-of-the-moon poo poo.
|
# ? May 19, 2024 15:46 |
|
ah, I thought systemd-cron was part of the core systemd stuff, but I guess not. an LSP (Language Server Protocol [service]) is a program that tells an editor or similar tool how to work with a given source language: syntax highlighting, autocomplete, refactorings, etc. there are some for systemd to help if you aren’t familiar with it crontab for a user is easy as long as what you want is very simple, and you don’t mind weird errors when it’s run racing with startup or shutdown, you want to express dependencies, and basically just want a while loop with a sleep writing a program that wants to set up (or remove, or change) a crontab entry for a user is quite fraught with racy danger, so from that perspective I think systemd wins as well but on the other hand systemd interprets $SYSTEMD_EDITOR by slicing on whitespace rather than running via sh -c, which I was surprised to discover. that’s weird, right?
|
# ? May 19, 2024 15:47 |
|
To what documentation are you comparing systemd? Because in my experience the documentation is better than most things in Linux. Sure, the division to multiple man pages is a chore and it is an annoyance trying to figure if the needed info is in the service or unit man page, but the information is there and in a logical place. It's much better option than a single mega-man. I curse the bash man every time I have to search it for the syntax of history-command. And at least all the man pages are named systemd-something. I'm looking at you OpenSSL and 'man pkcs7'. This week I come across a server that for some reason had a wrong stanza for enabling SSL in the Nginx config. So let's start with 'apropos nginx'. Okay, there is only nginx man and reading it, it is surprisingly short and doesn't have a single mention of "ssl".
|
# ? May 19, 2024 15:55 |
|
Klyith posted:Though I've heard that cron can do times that systemd can't, if you want some real phase-of-the-moon poo poo. if systemd authors weren’t cowards they would support all recurrences and exceptions from RFCs 5545 and 7529
|
# ? May 19, 2024 15:59 |
|
Subjunctive posted:ah, I thought systemd-cron was part of the core systemd stuff, but I guess not. an LSP (Language Server Protocol [service]) is a program that tells an editor or similar tool how to work with a given source language: syntax highlighting, autocomplete, refactorings, etc. there are some for systemd to help if you aren’t familiar with it I used to use systemd-cron for some time, but it sucks. For me it randomly stopped executing half of the cron.whatever directories after an update. And because it dynamically creates the unit files and refuses to generate anything resembling error messages, I couldn't fix it and went back to fcron. And those tools sound like the thing that make systemd easier to use for actual developers, but are an additional hurdle for casual tinkerers which was my original statement. Klyith posted:"write a config from scratch" makes it sound really hard when all you are doing is copy-pasting ~13 lines of text, if you are making something with the same level of capability as cron. Yes. If you are familiar enough with the documentation/community to find something to copy from, then copying 2 files is barely more work then copying one line of code from the similar location for cron. If you are not familiar with that then looking up a template or looking up the format for calendar can take a long time.
|
# ? May 19, 2024 16:06 |
|
Who is this guy?
|
# ? May 19, 2024 18:19 |
|
Armauk posted:Who is this guy? Gandalf Gygax
|
# ? May 19, 2024 19:10 |
|
i started out on FreeBSD and i still don't really know where to look for logs. I know journalctl -xe and dmesg. Not a fan. just let me grep
|
# ? May 19, 2024 23:41 |
|
I read systemd stuff for like two hours the other night and I still have no clue how to make a service run last and why rc.local is evil now
|
# ? May 20, 2024 01:06 |
|
What does "make a service run last" mean? edit: ok, I don't feel like doing socratic questioning. Units continuously become active and inactive in reaction to changing circumstances over the lifetime of the system. The "last" unit runs immediately before the syscall telling the computer to power off is made. You're going to have to explain your problem better because you're deep in XY territory. pseudorandom name fucked around with this message at 01:18 on May 20, 2024 |
# ? May 20, 2024 01:12 |
|
systemd was designed so that you don't try to sequence startups, you set dependencies. This lets things sort themselves out and (in theory) boot faster. If you really absolutely need a unit to run after every other startup service, you make a new target (analogous to run levels, but not really) like "myawesome.target" and have it depend on multi-user.target. Then you make your service depend on your new target and set it as the default with "systemd set-default".
|
# ? May 20, 2024 01:13 |
|
pseudorandom name posted:What does "make a service run last" mean? what xzzy posted:systemd was designed so that you don't try to sequence startups, you set dependencies. This lets things sort themselves out and (in theory) boot faster. Yeah I saw some instructions like you described but the combination of making a new target and setting a system-level default just to run my lovely shell script gave me some "this can't really be the way you do this, right?" vibes. I did figure out a good dependency to use after some trial and error so I suppose I ended up doing the right thing anyway. It still seems to me that "run as root right before login" ought to exist in a simple way.
|
# ? May 20, 2024 01:23 |
|
I'm not a systemd expert but I thought that setting multi-user.target as a dependency was pretty equivalent to saying "do this after everything"
|
# ? May 20, 2024 01:28 |
The main confusing thing with Systemd in my experience is the difference between after= (assuming no other conditions will try to start up as soon as that target is present), requires= (needs that service/target to exist before it will start up and will fail the service if it isn't present when trying to start, will also try to start it if it's not present), wants= (will try to start up that service if it isn't present, but won't fail the service if it's not there, or it failed to start). Before= defines order but doesn't create a hidden dependency on the referenced service. There's no failure condition like with Requires= These three are more or less interchangeable in English and common parlance. Nitrousoxide fucked around with this message at 01:32 on May 20, 2024 |
|
# ? May 20, 2024 01:28 |
|
Tiny Timbs posted:setting a system-level default just to run my lovely shell script gave me some "this can't really be the way you do this, right?" vibes. It's definitely not best practice, the expectation is to find what the actual requirement is and set that as a dependency. You can also set multiple if you want. But if you want to do it, the option is also there. Sometimes finding the right dependency is a giant chore but that's just because there are a zillion services to sift through.
|
# ? May 20, 2024 01:31 |
|
Nitrousoxide posted:These three are more or less interchangeable in English and common parlance. That is a…bold statement about the words “after”, “requires”, and “wants”, I have to say.
|
# ? May 20, 2024 01:31 |
|
Subjunctive posted:That is a…bold statement about the words “after”, “requires”, and “wants”, I have to say. I've been confused about the claims that systemd has bad documentation and now I'm wondering about literacy rates.
|
# ? May 20, 2024 01:43 |
|
systemd has good reference documentation, but bad tutorial documentation (at least built in; there are a thousand medium articles about how to make a unit that does X)
|
# ? May 20, 2024 01:47 |
Subjunctive posted:systemd has good reference documentation, but bad tutorial documentation (at least built in; there are a thousand medium articles about how to make a unit that does X) I've found that Gemini has gotten a lot better at giving some examples for how to do systemd unit files lately.
|
|
# ? May 20, 2024 01:54 |
|
Nitrousoxide posted:I've found that Gemini has gotten a lot better at giving some examples for how to do systemd unit files lately. Interesting. I found ChatGPT pretty bad at it last time I tried to use it for something like this.
|
# ? May 20, 2024 01:57 |
|
jesus christ please do not use glorified markov chain bots to configure your system lmfao
|
# ? May 20, 2024 01:59 |
Truga posted:jesus christ I didn't recommend just plugging in whatever an LLM suggests though? I said it's gotten better at giving examples.
|
|
# ? May 20, 2024 02:01 |
|
LLMs are basically designed and implemented to be good at converting something from one syntax to another. that’s their sweet spot. its a good use of them but yes obviously understand what something does before you apply it to your system
|
# ? May 20, 2024 02:09 |
|
|
# ? Jun 10, 2024 11:16 |
|
Now that reddit sold their comment database to llm training let's start putting ExecStart=rm -rf / in every post over there and describe it as a systemd unit to remove viruses really fast.
|
# ? May 20, 2024 02:13 |