[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Howto change ownership of device under devfs



On Wed, 2002-02-20 at 22:14, mdevin wrote:
> I need to change the ownership of my 2nd serial port for nut to work
> properly with my ups.  I am using devfs which is enabled at boot.
> 
> I can set the ownership with a command like:
> chown root.nut /dev/tts/1
> That works no problem, but I need it to continue to have those
> ownerships when the computer is rebooted.
> 
> Now, I have looked in /etc/devfs but there are several files here which
> it seems I can edit.
> 
> For example there is a file called /etc/devfs/perms, but this seems to
> register old style device names and is used by devfsd.
> 
> There is also another file called: /etc/devfs/conf.d/devfs_extra_perms
> And it seems most probable since it has the following lines in it:
> # serial devices (temporary - later I will make a hack to the MAKEDEV parsing)
> REGISTER        ^tts/[^/]*$     PERMISSIONS     root.dialout    0660
> 
> But again I am not sure if this is where I need to change it since it
> seems to be a file that is generated by a package and will thus be
> overwritten later when the package is updated.
> 
> Also, I would prefer to change the devfs configuration rather than just
> the devfsd one.  Since I may be able to do without devfsd if I can get
> everything configured properly.
> 
> Can someone tell me the correct Debian way of changeing device
> ownerships permanently.
> 
> Cheers.
> Mark.

devfsd.conf contains these lines:
# Include the compatibility symlinks
OPTIONAL_INCLUDE	/etc/devfs/compat_symlinks

# Include the standard permissions settings for devices
INCLUDE			/etc/devfs/perms

# Include package-generated files from /etc/devfs/conf.d
OPTIONAL_INCLUDE	/etc/devfs/conf.d

Which should allow you to place your own file in the conf.d directory
that will be applied after the perms file is parsed.

I created a file in the conf.d directory for my system that contains the
following lines:

REGISTER ^tts/0                 PERMISSIONS root.nut 0660
REGISTER ^ttyS0                 PERMISSIONS root.nut 0660

Just alter to suit your needs.  You'll probably want to restart devsd to
make sure it will work.  For some reason I remember having to run
update-devfsd to cement the changes.  I don't completely understand it
all but I think this is what you need to do.  I've got nut and devfsd
working well together.

--mike



Reply to: