Re: [systemd-devel] systemd-udevd -any way to list triggered rules with their files etc ?

2022-10-02 Thread Greg KH
On Mon, Oct 03, 2022 at 02:17:04AM +, Branko wrote:
> 
> cat /etc/udev/rules.d/99-zz-network.rules:
> ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66",
> NAME="wlan17", OWNER="chosen_user", GROUP="chosen_group", MODE="0666"

Network devices do not have a group/owner/mode at all.

> I know it does get triggered, since after replugging the WIFi stick I
> do get "wlan17" interface.But resulting created device in
> /dev/bus/usb/00x/00y gets created with MODE=0640 and root:usb

That is the usbfs device node, not the network device.  If this is a
network device, why do you care about the usbfs connection to the device
and not the normal network device name?

thanks,

greg k-h


[systemd-devel] systemd-udevd -any way to list triggered rules with their files etc ?

2022-10-02 Thread Branko
I have heap of problems with udev on systemd.

How is one supposed to troubleshoot rule processing ?

I did do "udevadm control --log-level=debug" and tried to modify
systemd-udevd.service, so that it forks-off just one chiled ( so tha
the log is easier to read), but that still doesn't tell me what was
triggered, where and why.

All I get in the log is that it mentions sime rules files in processing
chain that happened to to contain some rule that had an IMPORT an
that's it

Now I have an USB WiFi dongle that I can persuade udev to rename BUT I
can't set its OWNER, GROUP OR MODE.

That is, within the same rule in my file in /etc/udev/rules.d, NAME gets
applied in the end result, but OWNER,GROUP and MODE do not.

I don't have a clue why. 
"udevadm test /sys/devices/pcie_path_to_my_device_node" shows me pretty 
much just the list of rule files that were read, few
lines about IMPORT buildin calls and resulting attributes.

On that list, my custom rule file in /etc/udev/rules.d IS listed at the
end of the chain as it should be.

Just to be sure, I removed my .link file for WI-Fi USB stick so that
there is no processing outside udev tree chain and I linked
/etc/systemd/network/99-default.link to /dev/null to prevent default
settings just in case.

cat /etc/udev/rules.d/99-zz-network.rules:
ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66",
NAME="wlan17", OWNER="chosen_user", GROUP="chosen_group", MODE="0666"

I know it does get triggered, since after replugging the WIFi stick I
do get "wlan17" interface.But resulting created device in
/dev/bus/usb/00x/00y gets created with MODE=0640 and root:usb

I'm at a loss here. How is one supposed to get more detailed info on
what's and WHY is going on with systemd-udevd tree processing ?






Re: [systemd-devel] Connect /usr/bin/init to docker container's STDOUT/STDIN

2022-10-02 Thread Barry



> On 30 Sep 2022, at 14:30, Nicola Mori  wrote:
> 
>  # Save the long-running PID on file
>  ps aux | grep "sleep infinity" | head -n 1 | awk '{ print $2 }' > 
> /container-pipes-pid

echo $! >/container-pipes-pid

See man bash for $! definition.

Barry




Re: [systemd-devel] Connect /usr/bin/init to docker container's STDOUT/STDIN

2022-10-02 Thread Nicola Mori

Nice tip, thank you!

Nicola

On 02/10/22 09:43, Barry wrote:




On 30 Sep 2022, at 14:30, Nicola Mori  wrote:

  # Save the long-running PID on file
  ps aux | grep "sleep infinity" | head -n 1 | awk '{ print $2 }' > 
/container-pipes-pid


echo $! >/container-pipes-pid

See man bash for $! definition.

Barry