HNHacker News
TopNewBestAskShowJobs

zxzax

603 karma · joined April 19, 2021

submissionscomments
zxzax··on Systemd: The Good Parts
I don't have a quote handy, but systemd maintainers have previously said they are not interested in also maintaining a giant public API of utility functions, on top of everything else.
zxzax··on Landlock merged in mainline for Linux 5.13
>Attempting to build sandboxes outside that software doesn't work well in practice.

I can't say I agree with this. If it were true, containers would not be so ubiquitous.

zxzax··on Systemd: The Good Parts
I don't want to put words in Greg's mouth, but if you check the code for udevd at this moment you can see a lot of use of utility headers that are not really appropriate for a libudev: https://github.com/systemd/systemd/blob/c54cfef3968613f9e86e...

Expanding udev's library would probably end up a decent size library of other functionality, I don't think there is any good way around needing this. This is not code that could be deleted from systemd if it was separated. The way eudev has handled it is by doing what you describe and copying those shared functions out from systemd: https://github.com/gentoo/eudev/tree/34b2037d379e33f1cf79a34...

The result of that being there are two copies of the same shared code floating around, which is what they were trying to avoid.

zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
The issue I know of is, you cannot really use waitpid(-1, ...) in the same process as waitpid(<pid>, ...), as it would create a race condition on which call consumes the pid first. You can mitigate it in some programs by doing a lookup after the waitpid(-1, ...), but still it's not really reliable for libraries to spawn child processes and use that function. See for example the notes here: https://developer.gnome.org/glib/stable/glib-The-Main-Event-...

If you need to multiplex a wait for multiple processes, it's safer to use epoll with several pidfds. But you still eventually may need to call waitid(-1, ...) to reap any forked processes, and there really is no good way around that.

zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
I don't know what you mean you'll need to break it again, this one particular hole is already plugged in Wayland. That won't cause additional breakage, and you'll still want to be plugging those additional holes like ptrace anyway.

Input injection is being worked on in a different library, that brings a standard API that's supposed to work the same across Wayland, X11, and with sandboxed contexts: https://gitlab.freedesktop.org/libinput/libei

zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
I get that, but everyone else also seems to have that attitude, so you see why it doesn't really get done when nobody has any wheat or bread :)
zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
IME, most of those functions tend to get implemented in the DE when it turns out they're actually useful, or some other mechanism can be used to activate them. So no reason to get hung up on that particular method to do it either.
zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
People have been asking for similar grab-type things since early on in Wayland, and there have been many proposals, but nobody has actually stepped forward to build such a permission system that would work everywhere and would not create additional security problems or would not severely overcomplicate things. It's not a simple thing to do, by any means. If you think you know how, I would urge you to get started designing it and contributing it to some of the major Wayland implementations.
zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
Wayland obviously cannot solve all security issues and privilege escalations in the underlying OS -- the solution to that problem would be to just disable debugging within that security context.

In Wayland the situation is also not so much different from Windows, you would just reconfigure and extend the DE itself. You are already relying on them to provide most of the UI to an extent.

zxzax··on Why Is It So Hard to Detect Keyup Event on Linux?
All of your concerns regarding music players are actually already addressed by the MPRIS spec: https://specifications.freedesktop.org/mpris-spec/latest/

This problem has been solved in the DEs for quite some time now, global hotkeys is probably the very last thing you want to reach for, when all other options are exhausted.

And when that happens, I don't know about other DEs, but the way you're describing with extensions is mostly how GNOME Wayland already works. If you want to intercept a key, you ship an extension for that, and display a UI to rebind the keys, or you can place additional entries in the system's keyboard settings panel. What you can't do is have random unprivileged processes intercept keys without the user's permission.

zxzax··on Systemd: The Good Parts
Can you elaborate? I found it very easy to interact with once I learned how to use the tooling (busctl, d-feet, etc). I also don't think I would say it's desktop-focused, it was designed for that use case originally, but it seems it can be used by anything else that happens to use a similar OOP-based RPC design (and it seems systemd is one of those things). Is there another replacement that's of a smaller scope that would cover all the use cases that systemd needs?
zxzax··on Systemd: The Good Parts
Again, what you are saying is not correct. You may be comparing their designs to other apps developed for other desktops using other toolkits, but that's not what is influencing GNOME. The space is saved compared to previous designs that were used by GNOME. Please consider comparing an old style GTK app with a new style GTK app:

Inkscape, old style: https://media.inkscape.org/media/resources/file/inkscape-0.4...

GNOME builder, new style: https://gitlab.gnome.org/GNOME/gnome-builder/raw/master/doc/...

The old style has four bars at the top (titlebar, menubar, toolbar, secondary toolbar). The new style merges them all into one bar and moves the menus into the hamburger menu. The margins may be bigger in the new style but ultimately, space is saved and the UI chrome is reduced. Also, GNOME Builder is not an application designed totally around touch screens -- it's a text editor, for typing into.

I sympathize if you don't like this style of app (and I encourage you to use different apps if you were used to having a lot of menus and toolbars, and you don't like the new style of GNOME apps), but what you are saying about the design goals and motivations does not match what the developers are actually doing.

zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
The issue is solved in any service manager as long as the service doesn't fork, when you are the parent process you can ensure that you don't reap the child before sending a signal.

Once the service forks then it becomes a problem. If you use cgroups it can be solved separately with the cgroup freezer, but there are still some open issues with this in systemd: https://github.com/systemd/systemd/issues/13101

zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
I don't think that would necessary solve it, since the maximum number you can have open is still RLIMIT_NPROC * RLIMIT_NOFILE, right? It seems it would still be a problem as long as it's greater than RLIMIT_NPROC. Edit: I suppose you could fix it as long as you could guarantee that NPROC * NOFILE * maxlogins < kernel.pid_max... but to me this is piling on more workarounds.
zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
Not really, most systems should set RLIMIT_NPROC to prevent that. If pidfds held onto the pid, it would create a new denial-of-service that allowed random other processes to keep zombie processes open, and the fix for it would actually allow you to circumvent that limit!
zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
But that's more working around the problems than fixing them, no? You can't really move all signal handling logic to a dedicated process, because every process can receive signals. And as for databases: every major production database I've seen implements its own authentication and permission scheme, so it can do things like provide ACLs on a more granular (per-table, sometimes per-row) basis.
zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
The problem was discussed quite a lot around the introduction of pidfds:

https://lwn.net/Articles/773459/

https://lwn.net/Articles/784831/

In essence it's a classic TOCTTOU.

zxzax··on Ghosts of Unix past, part 3: Unfixable designs (2010)
I think the idea with that was it would lead to denial-of-service type situations where some process could leak a bunch of pidfds and then that would cause exhaustion of pids everywhere else.
zxzax··on Systemd: The Good Parts
I looked into this a while ago -- a traditional transactional CRUD database is totally unnecessary here, these are not files that you want to be editable by random tools. The journald log files have the important property that they are append-only by a single-writer. I agree there are some outstanding issues but those issues should just be fixed, instead of throwing it all out and moving to an even more complicated database layer that brings with it all its own additional problems. I think it would be perfectly feasible for someone to improve the indexing to show the latest 10 lines, or to write a fsck-type tool to repair damaged logs.
zxzax··on Systemd: The Good Parts
Having a lot of small composable functions and a lot of singly linked lists describes most functional programming languages though. I think that's only one part of the traditional Unix design. Though to me it was always seemed like the inspiration goes the opposite way -- it seems like Unix was in some ways designed as a "Lisp-like," where the shell works as a somewhat restricted version of functional programming that only operates on one data type.
zxzax··on Systemd: The Good Parts
This is a common thing I hear but it's not true. The hamburger menus were done to save space and reduce clutter, not out of any desire to be a tablet app. I sympathize with your criticism but it wasn't done for that purpose, it's just a coincidence. Also I should note, there are many non-tablet laptops that happen to have touch screens. These are not exactly rare these days, and AFAIK that was also a hardware segment that Microsoft was targeting, not just tablets. They weren't just making touch interfaces to sell the odd Surface or two. Sadly I don't know of any more elegant solution to this than what they're already doing, apps that want to work well here always have to straddle an awkward line where they have to support both traditional mouse and keyboard operation, as well as touch screens, at the same time. It's not an easy thing to design apps for.

To actually make good native touch/tablet apps in GNOME, you need to use a separate library called libhandy (renamed libadwaita for GTK4), and the app needs to be designed in a different way. You can usually tell the difference with an app made specifically for touch screens because it will totally de-emphasize the keyboard and mouse. I see more and more of these type of apps but only in the last couple of years, and it's mostly not to target tablets but to target the new open source phones e.g. Librem, Pinephone, etc.

zxzax··on Systemd: The Good Parts
I have to say, that seems like a strange requirement: I have never really considered Emacs (or Lisp) to be particularly Unix-like at all! I think the plan 9 people would probably tell you to ditch Emacs and use acme (Me personally, I say use whatever you want).
zxzax··on Systemd: The Good Parts
The customization in the desktop of GNOME itself is still there, but it has mostly moved to shell extensions. If you're willing to deal with that, you can change quite a bit of functionality.

The apps are a different story, those tend not to go for a lot of customization and will usually just focus on optimizing for one or two use cases. If you have other use cases, the suggestion there would probably be to make a separate app.

zxzax··on Systemd: The Good Parts
Sorry I wasn't clear -- most of the stuff I was talking about (hashmaps, b-trees, parsers, low-level utility functions, etc) is the private and unstable stuff, in the sense that it's a little too specialized towards systemd's style of C coding to warrant making it a public API, but it's useful enough to be shared between all the systemd components including udev. That's all the "private special sauce" is, it really doesn't make it any harder to deploy separately. They're not totally separate projects but there also is nothing really in common between them besides the build time dependency. Does that make sense?
zxzax··on Systemd: The Good Parts
I think the comments towards the bottom of this thread is what is being referred to: https://web.archive.org/web/20140928104327if_/https://plus.g...
zxzax··on Systemd: The Good Parts
Does it really make a difference whether it's called libsystemd or something else? If you're talking about the other functionality that's private and unstable, it's not included in a separate library for exactly that reason: it's considered private and unstable (Also I'm not sure if you're joking with that name but I really doubt there would ever be something like this literally called "libredhat," that makes about as much sense as putting a random b-tree implementation in a library called libubuntu or a libgentoo).
zxzax··on Systemd: The Good Parts
I don't know the status of this on a practical level (e.g. in any given distro) but systemd does support daemonless dbus access over a private socket (/var/run/systemd/private) in some scenarios. Would that help?
zxzax··on Systemd: The Good Parts
I've seen a lot of these comments to this effect but I'm still not quite sure: what is the issue with dbus? Is there another replacement that meets all the use cases?
zxzax··on Systemd: The Good Parts
It has been supported for at least the last 9 years now, I don't see why they would have any reason to break it.

>The main reason why they haven't yet is most likely that their attempts to integrate dbus into the kernel and systemd more tightly were rejected by the kernel devs; if I remember rightly that was expected to be the point at which you could not use it without systemd.

That seems quite dubious, udev has never depended on dbus, and there really would be no reason for it to ever do that.

>Using the kernel interfaces that udev relies on without using udev itself is also unsupported and the developers consider it within their rights to break those as well.

This I know is true, the netlink stuff varies really wildly from driver to driver. The alternative would be to put udevd and the other userspace bits into the kernel, which I really doubt anyone wants to do.

zxzax··on Systemd: The Good Parts
If plan 9 is what you want, I would encourage you to use 9front. I can't see why you would use Linux if you didn't like Red Hat, they have been a key contributor in Linux land for a long time, employing many long-time kernel developers.
← PreviousPage 9 of 14Next →