Live data from Hacker News

Systemd by Example (2021)

seb.jambor.dev

21–30 of 115 posts

Re: Systemd by Example (2021)

#21
post #13

A lot of people still probably hate on systemd, but it and journalctl are pretty nice to me.

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 established component of a modern Linux system.

Re: Systemd by Example (2021)

#22
post #20

funny, to me systemd == no docker, no containers, just a VM. it's my goto way to keep my programming running and have it be restarted if the vm reboots. I use VMs like "pods". I deploy code directly to the VM and run it there along with other programs. I scale up and scale down with: https://www.pulumi.com/

If I correctly understand your point, then it's worth noting the article is using a container merely to showcase the different parts of systemd in a sterile, reproducible environment. They're not running containers as systemd services, even though that's possible with podman Love Pulumi btw

oh I guess I mean "most kids today" know nothing of running code outside docker. And don't ever need systemd. The "orchestration" of their pods is done by k8s. But I just don't get why. The extra complexity for what? Just make each ec2 instance VM a pod.

Re: Systemd by Example (2021)

#23
Back in the day when LinuxAcademy was still cool, I asked for a systemd course... and they did it. Can't find the link right now, but that was what made systemd really click for me.

Weird that still there is no apress/o'reilly/packt/manning introductory book about systemd.

Re: Systemd by Example (2021)

#24
Systemd 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

Re: Systemd by Example (2021)

#25
post #21
post #13

A lot of people still probably hate on systemd, but it and journalctl are pretty nice to me.

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…

[deleted]

Re: Systemd by Example (2021)

#26
I 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 invoking a script prior to powering off but no amount of cajoling, poring over documentation, or reading and adapting examples from forum posts on my part would get systemd to do it automatically without conflicts, race conditions, or timeouts. Is this not exactly the kind of problem systemd dependences are intended to solve?

Re: Systemd by Example (2021)

#27

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 also has shorthands like "hourly": https://www.man7.org/linux/man-pages/man7/systemd.time.7.htm...

The man page lists: minutely, hourly, daily, monthly, weekly, yearly, quarterly, semiannually (and "annually" further down in examples).

It doesn't have a "hourly" directory where you can drop in scripts though, AFAIK.

Re: Systemd by Example (2021)

#28
post #21
post #13

A lot of people still probably hate on systemd, but it and journalctl are pretty nice to me.

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…

> The UX of systemd tools (systemctl, journalctl) is a bit crap, to be honest

Huh, what do you mean? I'm pretty happy with those.

Re: Systemd by Example (2021)

#29

Systemd is a pretty neat little thing. It's what keeps me running Ubuntu and Debian servers instead of switching to Alpine, at least in those situations where I can't containerize what I want to do. The thing that got me into it was systemd timers. I really like being able to split up what should run from when should it run. `cron` works best if you desire simplicity above all else, and Slack used `cron` for a very l…

>`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.

Debugging and tracability is just nuts too. With a timer and a run-once service it's easy to see what happens, happened, and will happen:

systemctl status foo.timer tells you when it has last triggered and when it will triggered next, if it is still enabled.

systemctl status foo.service tells you if it has been triggered from the timer and when, or ran manually with start

I get the conceptual utter simplicity of cron in place of timer + a script in place of service but in practice systemd is much simpler and more consistent to manage.

Re: Systemd by Example (2021)

#30
post #23

Back in the day when LinuxAcademy was still cool, I asked for a systemd course... and they did it. Can't find the link right now, but that was what made systemd really click for me. Weird that still there is no apress/o'reilly/packt/manning introductory book about systemd.

A casualty of acquisitions, I think. Linux Academy got bought by A Cloud Guru, who then got bought by Vista Equity along with Pluralsight. I think the material lives there now [0].

Packt does have "Linux Service Management Made Easy with systemd" as of Feb 2022, but I've not yet read it.

[0] https://www.pluralsight.com/cloud-guru/courses/mastering-sys...

[1] https://www.packtpub.com/product/linux-service-management-ma...

Post reply on HN