vmihalko / t2_polkit

Other
0 stars 0 forks source link

meson: Use the libexec directory per user/distro settings - [closed] #360

Closed vmihalko closed 1 year ago

vmihalko commented 1 year ago

In GitLab by @Conan_Kudo on Dec 19, 2022, 24:50

Merges use-correct-libexec-path -> master

Meson correctly supports expressing the libexec path for various FHS configurations. Moreover, with FHS 3.0, the default /usr/libexec path is acknowledged and now the Fedora, Debian, and SUSE distribution families use this path.

For distributions that use something else (particularly non-FHS compliant hierarchies), this makes it possible to build it properly.

vmihalko commented 1 year ago

In GitLab by @Conan_Kudo on Dec 19, 2022, 17:05

added 2 commits

Compare with previous version

vmihalko commented 1 year ago

In GitLab by @jrybar on Feb 2, 2023, 12:54

added 5 commits

Compare with previous version

vmihalko commented 1 year ago

In GitLab by @jrybar on Feb 2, 2023, 17:10

Hello,

the current implementation doesn't seem to break FHS [1][2].
On the other hand, this MR would require immediate backport to Fedora and change of spec, so our CI is not broken, and TBH I fail to see the feeling of an accomplishment or amelioration. Should this be done for other, stronger reason than "because we can"?
Thanks.

vmihalko commented 1 year ago

In GitLab by @Conan_Kudo on Feb 2, 2023, 18:39

A couple of distro maintainers for polkit requested this and asked me to submit this change on their behalf. There's a desire to make things more consistent, hence making this change.

vmihalko commented 1 year ago

In GitLab by @jrybar on Feb 6, 2023, 15:03

Above all, I encourage everyone, esp. maintainers, to not hesitate to use the ML (or gitlab issues or this MR in the end). TBH I'm really looking forward to seeing a discussion started about any topic in order to push polkit's development further.

Now to the topic:
I understand that the schism may be upsetting for someone, however, the question is, what would this make polkit aligned with? Systemd is also in /usr/lib in major distros (fedora, debian, arch).
I'm all in to make a change in codebase if there are reasons to do it and voices for the change.

vmihalko commented 1 year ago

In GitLab by @Conan_Kudo on Feb 6, 2023, 15:25

systemd is in /usr/lib because of an annoying historical reason where it needed part of it to live in / and there's no /libexec. Most projects aren't quite so bound to that restriction (especially not polkit).

This change would align polkit with the FHS structure followed today by Fedora, Debian/Ubuntu, and openSUSE. All of them use and prefer /usr/libexec.

vmihalko commented 1 year ago

In GitLab by @jrybar on Feb 8, 2023, 13:29

This change would align polkit with the FHS structure

Like I said in my first comment, FHS, supported by the links above, doesn't require such binaries to be put in /usr/libexec. It is marked as "optional". Pages for both the directories describe the same purpose. Same as in Fedora Guidelines, where packagers are encouraged to do so, not required.
It would make perfect sense for a new project, but moving files from /usr/lib to /usr/libexec breaks our Packit integration and above all, it would probably break SELinux policy.
There are no strong benefits stated so far (or discussed) that would overweight the effort required for this change.

systemd is in /usr/lib because of an annoying historical reason

After consultation with systemd and strace maintainers, the historical reason is that support for /usr/libexec was added quite recently in FHS and still is optional. I guess there are as same reasons for systemd to not have moved the files as for polkit.

If there are justifying reasons for this change that haven't been listed yet, please don't hesitate to reply to this comment.
Otherwise I find this MR ready to be Closed tomorrow.

Thank you for your time and effort.

vmihalko commented 1 year ago

In GitLab by @Conan_Kudo on Feb 8, 2023, 13:36

After consultation with systemd and strace maintainers, the historical reason is that support for /usr/libexec was added quite recently in FHS and still is optional. I guess there are as same reasons for systemd to not have moved the files as for polkit.

This is not exactly the truth. When systemd fully supported non-UsrMerged systems, systemd needed to be split across / and /usr. There is no /libexec (for binaries) or /share (for configuration) in FHS, so for simplicity, systemd put its stuff in /lib and /usr/lib.

This problem doesn't apply for Polkit. Moreover, Debian and openSUSE have both adopted and now prefer having private binaries in /usr/libexec just as Fedora has.

With my Fedora; Mageia; and openSUSE hats, I would prefer to have this fixed. And maintainers from other distributions also have indicated to me that they'd like this fixed. As for why they don't want to chime in here, I don't know. :shrug:

vmihalko commented 1 year ago

In GitLab by @mbiebl on Feb 9, 2023, 17:24

Let me chime in here (with my Debian maintainer hat on) :-)

$ ps aux | grep /usr/libexec
root         679  0.0  0.0 237840  9216 ?        Ssl  12:19   0:00 /usr/libexec/accounts-daemon
root         682  0.0  0.0  12788  5468 ?        Ss   12:19   0:00 /usr/libexec/bluetooth/bluetoothd
root         685  0.0  0.0  15872  3568 ?        Ss   12:19   0:00 /usr/libexec/iwd
root         689  0.0  0.0 237704  6728 ?        Ssl  12:19   0:00 /usr/libexec/power-profiles-daemon
rtkit        691  0.0  0.0  22684  1268 ?        SNsl 12:19   0:00 /usr/libexec/rtkit-daemon
root         703  0.0  0.1 396452 16792 ?        Ssl  12:19   0:01 /usr/libexec/udisks2/udisksd
root         705  0.0  0.0 234924  7020 ?        Ssl  12:19   0:02 /usr/libexec/upowerd
root         855  0.0  0.0   5832  1364 ?        Ss   12:19   0:00 /usr/libexec/lxc/lxc-monitord --daemon
colord       939  0.0  0.0 244156 14488 ?        Ssl  12:19   0:00 /usr/libexec/colord
michael     2094  0.0  0.0 238276  9184 ?        Ssl  12:20   0:00 /usr/libexec/gvfsd
michael     2105  0.0  0.0 380364 10588 ?        Sl   12:20   0:00 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f
michael     2121  0.0  0.2 630756 41928 ?        SNsl 12:20   0:01 /usr/libexec/tracker-miner-fs-3
michael     2123  0.0  0.0 159804  8068 tty2     Ssl+ 12:20   0:00 /usr/libexec/gdm-wayland-session /usr/bin/gnome-session
michael     2126  0.0  0.0 298880 15148 tty2     Sl+  12:20   0:00 /usr/libexec/gnome-session-binary
michael     2159  0.0  0.0  88356  4904 ?        Ssl  12:20   0:00 /usr/libexec/gcr-ssh-agent /run/user/1000/gcr
michael     2161  0.0  0.0  89152  6920 ?        Ssl  12:20   0:00 /usr/libexec/gnome-session-ctl --monitor
michael     2173  0.0  0.1 594888 17120 ?        Ssl  12:20   0:00 /usr/libexec/gnome-session-binary --systemd-service --session=gnome
michael     2174  0.0  0.0 237348  9036 ?        Ssl  12:20   0:00 /usr/libexec/xdg-permission-store
michael     2182  0.0  0.0 352672 13656 ?        Ssl  12:20   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
michael     2191  0.0  0.0 234068  8088 ?        Ssl  12:20   0:00 /usr/libexec/gvfs-goa-volume-monitor
michael     2196  0.0  0.1 903192 29820 ?        SLl  12:20   0:00 /usr/libexec/goa-daemon
michael     2211  0.0  0.0 313244  9408 ?        Sl   12:20   0:01 /usr/libexec/goa-identity-service
michael     2216  0.0  0.0 311464  9024 ?        Sl   12:20   0:00 /usr/libexec/at-spi-bus-launcher --launch-immediately
michael     2233  0.0  0.0 312952  9844 ?        Ssl  12:20   0:00 /usr/libexec/gvfs-afc-volume-monitor
michael     2238  0.0  0.0 235088  7540 ?        Ssl  12:20   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
michael     2244  0.0  0.0 234000  7528 ?        Ssl  12:20   0:00 /usr/libexec/gvfs-mtp-volume-monitor
michael     2326  0.0  0.0 911120 12996 ?        Ssl  12:20   0:00 /usr/libexec/glib-pacrunner
michael     2357  0.0  0.0 860488 16160 ?        Sl   12:20   0:00 /usr/libexec/gnome-shell-calendar-server
michael     2363  0.0  0.2 1176044 43240 ?       Ssl  12:20   0:00 /usr/libexec/evolution-source-registry
michael     2375  0.0  0.0 163276 10624 ?        Ssl  12:20   0:00 /usr/libexec/gvfsd-metadata
michael     2385  0.0  0.5 2238756 91904 ?       Ssl  12:20   0:04 /usr/libexec/evolution-calendar-factory
michael     2393  0.0  0.0 164296  8792 ?        Sl   12:20   0:00 /usr/libexec/at-spi2-registryd --use-gnome-session
michael     2425  0.0  0.0 308352 10380 ?        Ssl  12:20   0:00 /usr/libexec/gsd-a11y-settings
michael     2427  0.0  0.1 341292 20680 ?        Ssl  12:20   0:00 /usr/libexec/gsd-color
michael     2428  0.0  0.0 356216 12764 ?        Ssl  12:20   0:00 /usr/libexec/gsd-datetime
michael     2429  0.0  0.0 383912  9976 ?        Ssl  12:20   0:01 /usr/libexec/gsd-housekeeping
michael     2431  0.0  0.1 340020 20376 ?        Ssl  12:20   0:00 /usr/libexec/gsd-keyboard
michael     2432  0.0  0.1 669532 23792 ?        Ssl  12:20   0:00 /usr/libexec/gsd-media-keys
michael     2434  0.0  0.1 451492 23376 ?        Ssl  12:20   0:00 /usr/libexec/gsd-power
michael     2437  0.0  0.0 247928 13140 ?        Ssl  12:20   0:00 /usr/libexec/gsd-print-notifications
michael     2438  0.0  0.0 455332 10192 ?        Ssl  12:20   0:00 /usr/libexec/gsd-rfkill
michael     2439  0.0  0.0 233752  8144 ?        Ssl  12:20   0:00 /usr/libexec/gsd-screensaver-proxy
michael     2441  0.0  0.0 464324 11804 ?        Ssl  12:20   0:01 /usr/libexec/gsd-sharing
michael     2442  0.0  0.0 460440 13224 ?        Ssl  12:20   0:00 /usr/libexec/gsd-smartcard
michael     2443  0.0  0.0 320344 10428 ?        Ssl  12:20   0:00 /usr/libexec/gsd-sound
michael     2444  0.0  0.0 456888 10848 ?        Ssl  12:20   0:00 /usr/libexec/gsd-usb-protection
michael     2445  0.0  0.1 340596 20820 ?        Ssl  12:20   0:00 /usr/libexec/gsd-wacom
michael     2503  0.0  0.0 231776  6248 ?        Sl   12:20   0:00 /usr/libexec/gsd-disk-utility-notify
michael     2510  0.0  0.3 955696 51056 ?        Sl   12:20   0:00 /usr/libexec/evolution-data-server/evolution-alarm-notify
michael     2587  0.0  0.0 342448 15352 ?        Sl   12:20   0:00 /usr/libexec/gsd-printer
michael     2603  0.0  0.0 235056  6712 ?        Sl   12:20   0:00 /usr/libexec/ibus-dconf
michael     2609  0.0  0.1 346020 22308 ?        Sl   12:20   0:03 /usr/libexec/ibus-extension-gtk3
michael     2612  0.0  0.0 234784  6604 ?        Sl   12:20   0:00 /usr/libexec/ibus-portal
michael     2666  0.0  0.0 161148  7336 ?        Sl   12:20   0:03 /usr/libexec/ibus-engine-simple
michael     2702  0.0  0.1 753664 18584 ?        Ssl  12:20   0:00 /usr/libexec/xdg-desktop-portal
michael     2712  0.0  0.0 608436 11292 ?        Ssl  12:20   0:00 /usr/libexec/xdg-document-portal
michael     2726  0.0  0.1 382692 25524 ?        Ssl  12:20   0:04 /usr/libexec/xdg-desktop-portal-gnome
michael     2758  0.0  0.2 770424 40240 ?        Ssl  12:20   0:00 /usr/libexec/evolution-addressbook-factory
michael     2840  0.0  0.1 345972 23228 ?        Ssl  12:20   0:01 /usr/libexec/xdg-desktop-portal-gtk
michael     2950  0.0  0.0 157284  8620 ?        Ssl  12:20   0:00 /usr/libexec/dconf-service
michael     3204  0.0  0.2 629284 44712 ?        Ssl  12:21   0:00 /usr/libexec/gsd-xsettings
michael     3228  0.0  0.1 191384 20636 ?        Sl   12:21   0:01 /usr/libexec/ibus-x11
michael    14088  0.0  0.0 312404 10116 ?        Sl   13:43   0:00 /usr/libexec/gvfsd-trash --spawner :1.7 /org/gtk/gvfs/exec_spaw/0
michael    23203  0.0  0.0 244308 11504 ?        Sl   16:30   0:00 /usr/libexec/gvfsd-http --spawner :1.7 /org/gtk/gvfs/exec_spaw/1

vs

$ ps aux | grep /usr/lib/
polkitd      762  0.0  0.0 314016 10352 ?        Ssl  12:19   0:00 /usr/lib/polkit-1/polkitd --no-debug
root        2049  0.0  0.0  42652  3680 ?        Ss   12:20   0:00 /usr/lib/postfix/sbin/master -w

it surely is a "cosmetic" issue. Then again, I like consistency and polkitd being an outlier seems odd.