Closed wentasah closed 2 years ago
This all looks good. I have copied it to Mark to see what he thinks. I'll test DynamicUser before merging as I've never used it before. If the group is created in Fedora then this should be seamless. Won't the group be plugdev on Debian?
Darryl
On Thu, May 5, 2022 at 7:37 AM Michal Sojka @.***> wrote:
Hi, this PR contains a few changes that resulted from packaging the recent version for Debian. Most of them should be harmless.
But commit fee8cdf https://github.com/darrylb123/usbrelay/commit/fee8cdffe7ae296e490eea4561dfad070b631087 might affect other distributions. With it it is not necessary to create a special user for running usbrelayd. The user is created automatically by systemd only when needed and removed when unneeded. On Debian, which uses plugdev group for accessing plugable devices, this means that neither the user nor the group has to be created statically. On distributions without plugdev group (Fedora? cc @mefuller https://github.com/mefuller), the group still needs to be created but the user needs not. And because DynamicUser in systemd requires https://www.freedesktop.org/software/systemd/man/systemd.exec.html#DynamicUser= that either both user and group are statically created or they both do not exist, we run the service under a different (dynamically created) user called usbrelayd (with d at the end). This could theoretically break some advanced setups, but I believe it is unlikely.
You can view, comment on, or merge this pull request online at:
https://github.com/darrylb123/usbrelay/pull/87 Commit Summary
- fee8cdf https://github.com/darrylb123/usbrelay/pull/87/commits/fee8cdffe7ae296e490eea4561dfad070b631087 Use DynamicUser for usbrelayd.service
- d5dc284 https://github.com/darrylb123/usbrelay/pull/87/commits/d5dc284ed2de9f3e2df0ad3a296688357b0308fd Add basic usbrelayd.8 man page
- f1b946f https://github.com/darrylb123/usbrelay/pull/87/commits/f1b946fcd5f788793a288c5aef57930d3f13bc20 Makefile: Put libraries at the end of the command line
- b94b1ff https://github.com/darrylb123/usbrelay/pull/87/commits/b94b1ff0046fd6b102a2b4bd82b1a5f8790a448d Add AppStream metadata
File Changes
(4 files https://github.com/darrylb123/usbrelay/pull/87/files)
- M Makefile https://github.com/darrylb123/usbrelay/pull/87/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52 (6)
- A io.github.darrylb123.usbrelay.metainfo.xml https://github.com/darrylb123/usbrelay/pull/87/files#diff-48dd537457fe5aea9549a90587dae1a230b7d7eca389f179e737c4c55d243dc6 (37)
- A usbrelayd.8 https://github.com/darrylb123/usbrelay/pull/87/files#diff-e3ec77d8d37cfc68a837d745597ac7606b69c183ed0f01fcf52b148259847c24 (20)
- M usbrelayd.service https://github.com/darrylb123/usbrelay/pull/87/files#diff-3943d785d9512f30c26ad46ec7052e6c57f8befe8aff37f48a7058cc9ac4b4ba (5)
Patch Links:
- https://github.com/darrylb123/usbrelay/pull/87.patch
- https://github.com/darrylb123/usbrelay/pull/87.diff
— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/pull/87, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVM5ZZNCPBALWDUUXNDVILUYZANCNFSM5VDIWRSA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Ok, Dynamic user shows the process thus on Fedora: usbrela+ 2312 1 0 16:34 ? 00:00:00 /usr/bin/python3 /usr/sbin/usbrelayd
The udev rule sets the group to usbrelay as expected: crw-rw----. 1 root usbrelay 241, 1 May 5 16:34 /dev/hidraw1
I shall merge it once Mark agrees.
Darryl
On Thu, May 5, 2022 at 4:30 PM Darryl Bond @.***> wrote:
This all looks good. I have copied it to Mark to see what he thinks. I'll test DynamicUser before merging as I've never used it before. If the group is created in Fedora then this should be seamless. Won't the group be plugdev on Debian?
Darryl
On Thu, May 5, 2022 at 7:37 AM Michal Sojka @.***> wrote:
Hi, this PR contains a few changes that resulted from packaging the recent version for Debian. Most of them should be harmless.
But commit fee8cdf https://github.com/darrylb123/usbrelay/commit/fee8cdffe7ae296e490eea4561dfad070b631087 might affect other distributions. With it it is not necessary to create a special user for running usbrelayd. The user is created automatically by systemd only when needed and removed when unneeded. On Debian, which uses plugdev group for accessing plugable devices, this means that neither the user nor the group has to be created statically. On distributions without plugdev group (Fedora? cc @mefuller https://github.com/mefuller), the group still needs to be created but the user needs not. And because DynamicUser in systemd requires https://www.freedesktop.org/software/systemd/man/systemd.exec.html#DynamicUser= that either both user and group are statically created or they both do not exist, we run the service under a different (dynamically created) user called usbrelayd (with d at the end). This could theoretically break some advanced setups, but I believe it is unlikely.
You can view, comment on, or merge this pull request online at:
https://github.com/darrylb123/usbrelay/pull/87 Commit Summary
- fee8cdf https://github.com/darrylb123/usbrelay/pull/87/commits/fee8cdffe7ae296e490eea4561dfad070b631087 Use DynamicUser for usbrelayd.service
- d5dc284 https://github.com/darrylb123/usbrelay/pull/87/commits/d5dc284ed2de9f3e2df0ad3a296688357b0308fd Add basic usbrelayd.8 man page
- f1b946f https://github.com/darrylb123/usbrelay/pull/87/commits/f1b946fcd5f788793a288c5aef57930d3f13bc20 Makefile: Put libraries at the end of the command line
- b94b1ff https://github.com/darrylb123/usbrelay/pull/87/commits/b94b1ff0046fd6b102a2b4bd82b1a5f8790a448d Add AppStream metadata
File Changes
(4 files https://github.com/darrylb123/usbrelay/pull/87/files)
- M Makefile https://github.com/darrylb123/usbrelay/pull/87/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52 (6)
- A io.github.darrylb123.usbrelay.metainfo.xml https://github.com/darrylb123/usbrelay/pull/87/files#diff-48dd537457fe5aea9549a90587dae1a230b7d7eca389f179e737c4c55d243dc6 (37)
- A usbrelayd.8 https://github.com/darrylb123/usbrelay/pull/87/files#diff-e3ec77d8d37cfc68a837d745597ac7606b69c183ed0f01fcf52b148259847c24 (20)
- M usbrelayd.service https://github.com/darrylb123/usbrelay/pull/87/files#diff-3943d785d9512f30c26ad46ec7052e6c57f8befe8aff37f48a7058cc9ac4b4ba (5)
Patch Links:
- https://github.com/darrylb123/usbrelay/pull/87.patch
- https://github.com/darrylb123/usbrelay/pull/87.diff
— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/pull/87, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVM5ZZNCPBALWDUUXNDVILUYZANCNFSM5VDIWRSA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Won't the group be plugdev on Debian?
Yes, it will. We will patch it in Debian-specific patches like this: https://salsa.debian.org/wentasah/usbrelay/-/blob/master/debian/patches/0003-Use-DynamicUser-for-usbrelayd.service.patch Since other distros might already use the usbrelay group, I don't want to break it for them.
-Michal
Mark created an rpm directory, I'll create a deb directory for the debian stuff. The patches can go there.
Mark created an rpm directory, I'll create a deb directory for the debian stuff. The patches can go there.
I don't think it's necessary to create a separate directory. The files in this PR would be useful for all distributions (if they are interested). I think that with this merged, Debian will need just a single patch changing usbrelay group to plugdev. And this does not need to live here.
I've got access to https://salsa.debian.org/debian/usbrelay, which is the official source of debian packaging. It's also planned that I will become "uploader" for the usbrelay package so future releases should appear in Debian faster than now.
Great - I was just about to give my approval here Thanks all
Ok, sounds good.
On Sat, May 7, 2022 at 3:28 AM Mark E Fuller @.***> wrote:
Great - I was just about to give my approval here Thanks all
— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/pull/87#issuecomment-1119836686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVNPCJXRVY27XS2PGQDVIVJCBANCNFSM5VDIWRSA . You are receiving this because you modified the open/close state.Message ID: @.***>
Hi, this PR contains a few changes that resulted from packaging the recent version for Debian. Most of them should be harmless.
But commit fee8cdffe7ae296e490eea4561dfad070b631087 might affect other distributions. With it it is not necessary to create a special user for running usbrelayd. The user is created automatically by systemd only when needed and removed when unneeded. On Debian, which uses
plugdev
group for accessing plugable devices, this means that neither the user nor the group has to be created statically. On distributions withoutplugdev
group (Fedora? cc @mefuller), the group still needs to be created but the user needs not. And because DynamicUser in systemd requires that either both user and group are statically created or they both do not exist, we run the service under a different (dynamically created) user calledusbrelayd
(with d at the end). This could theoretically break some advanced setups, but I believe it is unlikely.