Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: etmpfiles-dev and udev cannot set permissions in /dev/: "Invalid Argument". (Read 483 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

etmpfiles-dev and udev cannot set permissions in /dev/: "Invalid Argument".

    etmpfiles and udev cannot set permissions in /dev/: "Invalid Argument".

    Since more than a month now, when
system/etmpfiles starts up the etmpfiles-dev service, it fails at setting permissions of files in /dev/.

A manual run of /etc/init.d/etmpfiles-dev (as root) prints the following to the terminal:
Code: [Select]
 * Setting up tmpfiles.d entries for /dev ...
fchmod() of /dev/fuse failed: Invalid argument
fchmod() of /dev/uinput failed: Invalid argument
fchmod() of /dev/snd/timer failed: Invalid argument
fchmod() of /dev/snd/seq failed: Invalid argument
fchmod() of /dev/rfkill failed: Invalid argument
fchmod() of /dev/loop-control failed: Invalid argument
fchmod() of /dev/net/tun failed: Invalid argument
fchmod() of /dev/vfio/vfio failed: Invalid argument
fchmod() of /dev/kvm failed: Invalid argument
fchmod() of /dev/vhost-net failed: Invalid argument
fchmod() of /dev/vhost-vsock failed: Invalid argument                                                                                                  [ !! ]
 * ERROR: etmpfiles-dev failed to start
[/tt]

Another way to try to set permissions of files under [tt]/dev/[/tt] is udev. I have an udev rule that wants to set the permissions of [tt]/dev/fuse[/tt] to [tt]0666[/tt]:
[code]
KERNEL=="fuse", GROUP="fuse", MODE="0666"
When I load the fuse kernel module, I observe that in the result /dev/fuse has the correct group ownership but wrong permissions (0600: Readable and writable only by the owner).
Running udevd with debug options prints the following to the terminal when loading the fuse kernel module:
Code: [Select]
fuse: Device is queued (SEQNUM=12773, ACTION=add)
Cleanup idle workers
Skipping overridden file '/usr/lib/udev/rules.d/99-fuse.rules'.
Skipping overridden file '/usr/lib/udev/rules.d/50-Brother_DSScanner.rules'.
Skipping overridden file '/usr/lib/udev/rules.d/50-qmk.rules'.
Skipping overridden file '/usr/lib/udev/rules.d/99-fuse3.rules'.
Skipping overridden file '/usr/lib/udev/rules.d/99-aw_usb.rules'.
fuse: Device ready for processing (SEQNUM=12773, ACTION=add)
Successfully forked off '(udev-worker)' as PID 22361.
fuse: Worker [22361] is forked for processing SEQNUM=12773.
fuse: Device is queued (SEQNUM=12774, ACTION=add)
Worker [22337] exited.
fuse: Processing device (SEQNUM=12773, ACTION=add)
fuse: Device ready for processing (SEQNUM=12774, ACTION=add)
fuse: Removing watch handle -1.
Successfully forked off '(udev-worker)' as PID 22362.
fuse: /usr/lib/udev/rules.d/50-udev-default.rules:106 MODE 0666
fuse: Worker [22362] is forked for processing SEQNUM=12774.
Worker [22336] exited.
fuse: Processing device (SEQNUM=12774, ACTION=add)
fuse: /etc/udev/rules.d/99-fuse.rules:2 GROUP 500
fuse: /etc/udev/rules.d/99-fuse.rules:2 MODE 0666
fuse: /etc/udev/rules.d/99-fuse3.rules:2 GROUP 500
fuse: /etc/udev/rules.d/99-fuse3.rules:2 MODE 0666
fuse: Setting permissions /dev/fuse, uid=0, gid=500, mode=0666
fuse: Failed to set owner/mode of /dev/fuse to uid=0, gid=500, mode=0666: Invalid argument
fuse: Successfully created symlink '/dev/char/10:229' to '/dev/fuse'
fuse: sd-device: Created empty file '/run/udev/data/c10:229' for '/devices/virtual/misc/fuse'
fuse: Device processed (SEQNUM=12773, ACTION=add)
fuse: sd-device-monitor(worker): Passed 203 byte to netlink monitor.
fuse: Device processed (SEQNUM=12774, ACTION=add)
fuse: sd-device-monitor(worker): Passed 154 byte to netlink monitor.
No events are queued, removing /run/udev/queue.

Note the fuse: Failed to set owner/mode of /dev/fuse to uid=0, gid=500, mode=0666: Invalid argument.

I stumbled upon this since I failed to get /dev/kvm to be group read and writeable, what I want to achieve for QEMU.

System information:
  • udevd --version: 255.2-1-artix
  • etmpfiles --version:
    Code: [Select]
    systemd 255 (255.2-1-artix)
    -PAM -AUDIT -SELINUX -APPARMOR -IMA -SMACK -SECCOMP -GCRYPT -GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP -LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 -LZ4 -XZ -ZLIB -ZSTD -BPF_FRAMEWORK -XKBCOMMON -UTMP -SYSVINIT default-hierarchy=unified
  • uname -srvmo: Linux 6.5.0-pf5 #1 SMP PREEMPT_DYNAMIC Sun, 15 Oct 2023 12:18:43 +0000 x86_64 GNU/Linux
What can be the issue here?, what might block etmpfiles or udev to set the permissions?

A manual chmod 0666 /dev/fuse works without issues.

Regards!

Re: etmpfiles-dev and udev cannot set permissions in /dev/: "Invalid Argument".

Reply #1
A hunch, it is related to the udev-255 version, which had some udev changes.

Does it also occur with either linux or lts artix kernel?

Re: etmpfiles-dev and udev cannot set permissions in /dev/: "Invalid Argument".

Reply #2
Does it also occur with either linux or lts artix kernel?
I just checked system/linux version 6.6.9.artix1-1 where this issue does not occur.

Does it mean udev 255 and up is not compatible anymore with olderâ„¢ kernels?

Regards and thanks for the hint!

Re: etmpfiles-dev and udev cannot set permissions in /dev/: "Invalid Argument".

Reply #3
Does it also occur with either linux or lts artix kernel?
I just checked system/linux version 6.6.9.artix1-1 where this issue does not occur.

Does it mean udev 255 and up is not compatible anymore with olderâ„¢ kernels?

Regards and thanks for the hint!


My guess would be, something in your custom kernel config is not set. Probably a diif of the config files will get you to have it working.
By now, it seems a kernel issue with your custom kernel.