Stephen Morris writes:
On 12/11/18 4:10 pm, Sam Varshavchik wrote:
>
>> I don't know about ACLs, but how about:
>>
>> setfacl -m u:nut:rw /dev/bus/usb/006/001
>>
>> from `man setfacl`
>
> That'll work until the next reboot, when everything gets reset.
Just my two cents worth, from my usage of setfacl against directories I use
it on, if the command setfacl -mR user:nut:rwx /dev/bus/usb/006/001 is issue
it will remain across boots unless something at boot time is removing it.
Nothing at boot time removes anything in the /dev directory, or the
directory itself.
That's because, you'll be surprised to learn that the /dev directory does
not exist in the first place. This is why I was specifically interested in
figuring out where the ACLs get properly specified, and why manually setfacl-
ing anything in /dev will never work.
You see, the /dev directory is a figment of your imagination.
If you poured over your root filesystem's raw disk blocks, looking for this
mysterious /dev directory, you will never find it.
As such, it is logically impossible for anything to be automatically
preserved across boots, since it never existed in the first place.
The last time an actual /dev directory existed, in its flesh and blood, on
Linux, was decades ago. The /dev directory you see now is a virtual
filesystem, that gets created from scratch on boot.
That's why trying to fix device permissions by chmod-ing or ACLing /dev
entries is an exercise in futility. It will be gone at the next boot.
Because it never actually really existed in the first place.
At least not until someone goes ahead and implements something that
preserves existing /dev ownership and permission before shutting down, and
restoring it at the next boot. That will never happen, of course, for the
very precise reason of /dev being the way it is, and, more importantly, why.