Live data from Hacker News

Avoiding Complexity with Systemd

mgdm.net

301–310 of 357 posts

Re: Avoiding Complexity with Systemd

#301

Earlier quoted context omitted.

Selinux can block systemd from making network sockets. What do you mean by "security model" in this case? What model is that?

By "cannot block systemd from making a network socket connection", I think GP meant that your system will break if you block systemd from making network socket connections, not that it's physically impossible to do so.

Yes. If you borked your systemd config file, system-wide failure. Non-bootable, non-useable.

Also if intransigent network connection occurs (fuZzing or not), untested errors occur … notably in PID 1 which isn’t easy to debug.

Re: Avoiding Complexity with Systemd

#302
post #255
post #170

Earlier quoted context omitted.

I’m glad to hear runit works fine for them. I’m not so sure there isn’t any room for improvement though. In the related s6 project there is lot of discussions about adding new features that are beneficial for supporting a modern Linux distro.

As a datapoint of one, I've been using Void Linux for near a decade. I haven't once been in a situation where I thought systemd would help. Granted, I don't run many custom services, but for what it does, runit does a great job. Something a bit more user friendly like s6 would be nice, but otherwise it stays out of my way and I don't think about it. NixOS/Guix would be worthwhile switching to, but Void is comfortably…

But... it's not modern!

Re: Avoiding Complexity with Systemd

#303

Earlier quoted context omitted.

There is still no way to filter application output at collection time, which can functionally make journald useless if you have an application that is too chatty, and will likely never be given that (AFAICT) there is hefty ideological opposition from the systems developers¹. ¹ https://github.com/systemd/systemd/issues/6432

Isn't this something that, to a degree, might be mitigated by rate limiting journald has? IMO Lennart is right in that collection should be optimized to a point where it is (almost) never the bottleneck. I, personally, would put a filtering program between the chatty application and journald.

The scenario I personally have is:

- Legacy application, with no access to source code.

- Company that wrote the application hasn't existed for a decade.

- It logs several useless lines every second. This is non-configurable, and includes a timestamp which makes each linue distinct.

- It also logs some very important lines that _must_ be responded to.

I don't think this is a unique situation to find yourself in, and currently this application is permitted - explicitly - to spam the journal to a point that it is effectively useless. Yes, you can use a filtering application to sit in between systemd but that's a workaround and not an actual solution (as stated in the issue linked above):

- it could not be "plugged in" via overlay (i.e. modification of Exec... is needed - this gets ugly especially if you have ExecStartPre/ExecStopPost)

- SyslogIdentifier has to be set to produce proper name in journald

- The filter itself has to be quite reliable (to not hang) and a bit sophisticated to properly handle signals, process shutdown, low disk space etc.

Re: Avoiding Complexity with Systemd

#304
post #104

Earlier quoted context omitted.

I really don't understand the scenario where binary logging is a problem. journalctl is a command just like, I dunno, gzip, and people are fine with gzipped logs. If something goes horribly wrong with your system, you're not looking at logs with an oscilloscope, you're looking at logs by mounting the disk on some other working OS - whether it's the initramfs, or a live CD, or whatever. You can run gunzip (Not to ment…

Binary logging would be fine if it Just Worked, but my experience is that journald/journalctl does not just work, and when it breaks I don't have logs. For example, if the system clock is not monotonic, my text logs are still written sequentially in order, and it's easy to figure out what happens. It is the stated view of the journald maintainers that, if your clock is not monotonic, you get to keep both pieces. http…

> (I can't find the bug for this, so I haven't verified that it's still open and unfixed at this time. But it has certainly existed for years at this point.)

https://github.com/systemd/systemd/issues/2913

I am so happy you mentioned this, as I am in a position of developing a daemon used by people who insist on using systemd, and I keep asking them for logs when things fail and, in fact, the most critical logs -- arguably the only ones that ever truly matter: the ones that come immediately before the daemon terminates for some reason -- are often missing. Now I know why :/.

https://unix.stackexchange.com/questions/291483/how-to-fix-u...

> So no, in principle I have no objection to _competent_ binary logs. Journald does not meet that bar.

Yeah... I hadn't even gotten to the end of your message before immediately going "omg I have to look into this" and the most apt description that was coming to my mind for a logging system that fails to actually store logs -- and particularly the most critical death throws to the log before termination -- is 100% "incompetent" :/.

Re: Avoiding Complexity with Systemd

#305
post #184

Earlier quoted context omitted.

Mamagement has 99 problems. Holding a status quo is about minimizing the backlog more than hating change as such. Even when we can show am improvement in security and usability, and lower training cost because of consistency, it's still another mouth to feed.

If it provides sufficient benefits (which systemd does), it is a no brainer.

As a technical matter, sure.

As a business/ management matter, we frequently cannot do the technically obvious thing due to other constraints.

Re: Avoiding Complexity with Systemd

#306
post #246

For me, systemd is the best thing since sliced bread. As a programmer, I now don't need to care about dropping privileges, managing logging, daemonization (the moment I need to do the double-fork dance again, chairs will be flying, I swear), dropping into a chroot, and do half-arsed guesses "is it up and running yet?" from a convoluted mess of shell code that looks like a bunch of hair stuck down a drain for a month.…

Wait until it automagically fails. It may be great for less-skilled people, but for anyone running anything where it's too critical to outsource support it's then necessary to have a systemd expert inhouse (and such a person has proven extremely hard to find).

A support contract from your distro of choice e.g. RedHat, Canonical (Ubuntu), SUSE, etc would potentially fill this void.

Re: Avoiding Complexity with Systemd

#307

Earlier quoted context omitted.

Wow, are people seriously still fussing about this? Systemd made the call to use a more secure default, they should be applauded for it. People who want the insecure way to be the default should take it up with their distro.

How is killing processes when the user "logs out" at all good for security? If the processes were malicious or vulnerable, they could have done their damage or been exploited while the user was still logged in.

You don't think malicious code could wait for certain specific times to trigger, rather than running immediately during an active login session where it could be traced back to?

Re: Avoiding Complexity with Systemd

#308
post #165

Earlier quoted context omitted.

> So like chroot and namespaces? Why do I have to depend on systemd when these are native features provided by Linux? Not like namespaces - using namespaces. And for the same reason we use other high level abstractions and high level languages rather than handcrafted assembly. You don't have to depend on it either - you can still use chroot instead of you want, but it's more work that way. > Great, but so do Docker a…

> You don't have to depend on it either - you can still use chroot instead of you want, but it's more work that way. How so? If I need filesystem isolation, I'll use the simplest tool that provides it. In this case probably a container runtime. Note that none of your criticism about Docker applies to Podman. Why would I ever want to use containers with a tool that forces (OK, strongly suggests...) me to use it as an…

> Note that none of your criticism about Docker applies to Podman.

It's not a criticism of docker. It's "docker does the same thing", because there are good reasons to abstract that functionality. I'm not familiar with podman internals.

> Why would I ever want to use containers with a tool that ...

Because you have to deal with those things always. You can do them yourself, you can do them with other services, or your can do them in the currently-most-common framework of systemd. You can still pick and choose from those elements as you want.

> You're just working at a higher level of abstraction, which can be comforting, but simplifying would be to use the underlying systems directly or using a tool that only focuses on a single aspect

I don't really see the namespaces and service management as different things. They're pretty much one idea these days.

It's also simplifying things because I can write my own script with the necessary unshare / mount / ip stuff. But the common patterns are repeating so much, I'd rather use a single option for it.

> Great, then the article shouldn't import systemd bindings

They're not bindings, just abstraction. Why should that be treated differently from "shouldn't import fmt, just concatenate strings", "shouldn't use rand, just open /dev/urandom"?

> My point is that the program is now tied to systemd systems.

Only in these examples. Actual apps normally autodetect the relevant variables and not rely on activation if it's not available. You're never tied to systemd activation / keep alive notification unless you choose to do it.

Re: Avoiding Complexity with Systemd

#309

For me, systemd is the best thing since sliced bread. As a programmer, I now don't need to care about dropping privileges, managing logging, daemonization (the moment I need to do the double-fork dance again, chairs will be flying, I swear), dropping into a chroot, and do half-arsed guesses "is it up and running yet?" from a convoluted mess of shell code that looks like a bunch of hair stuck down a drain for a month.…

The choice isn't systemd or roll-your-own-init-system. There are alternatives like runit, openrc etc.

You can do the same painless setup (arguably even easier) with runit as the base template requirement is literally just

    #!/bin/sh
    the_executeable &
Granted, logs in runit are optional but there are problems with default logging too, e.g. Docker will keep filling logs until the disk is full unless you explicitly tell it not to in either its configuration or your own custom log rotation rules. Neither of which are default.

Re: Avoiding Complexity with Systemd

#310
post #287
post #205

Earlier quoted context omitted.

I honestly would like to see a better service manager than systemd, but just my opinion from following development of these things: a huge reason why it can't happen comes from underlying deficiencies in the kernel, and with Unix. The real core issues can't be addressed without a large amount of changes there, which are outside the control of a service manager.

I'd love to see a later development of a proper system manager that learns from systemd's faults and allows for compatible interfaces for transition. Much like Pipewire exposes PulseAudio interfaces but is implemented differently.

To me it's the other way around -- pipewire is the sound server equivalent of systemd. For better or for worse.
Post reply on HN