Koozali.org: home of the SME Server

Best practice to modify /dev permissions

Offline christian

  • *
  • 369
  • +0/-0
    • http://www.szpilfogel.com
Best practice to modify /dev permissions
« on: October 25, 2008, 05:18:27 AM »
In a solution I was working on, I need to have the permission of a serial device changed.

By default udev will reset the permissions set on each reboot which I believe is controled by
 /etc/udev/permissions.d/50-udev.permissions

In CentOS 5 this is apparently changed/merged into rules.d.

For the experts in the forum, what would be the best practice to make the permission modification?

I could make the change in the init.d script for the service and I think that would stick but it seems a little kludgey.

I could add a 51-udev.local.permissions (or perhaps that should be 49-udev.local.permissions) and put my change there for the specific device but I think this will break on the CentOS 5 upgrade in SME 8.

Is there a best practice?
« Last Edit: October 25, 2008, 05:20:50 AM by christian »
SME since 2003

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Best practice to modify /dev permissions
« Reply #1 on: October 25, 2008, 06:57:46 AM »
Always use a custom-template.  You can create custom templates even for files that don't currently use templates.  eg:

/etc/e-smith/templates-custom/etc/udev/permissions.d/51-udev.local.permissions

Also (if needed) make sure and create a templates.metadata file to set the user and perms of the expanded file.

Major upgrades require that you move your custom templates and apply them one at a time after you upgrade.  This way you know which ones work and which ones need to me modified.  If COS5 changes this, then you will need to update your custom template after the upgrade.

Also, if you make a custom template, you will always be able to find your changes in the templates-custom tree.
In life, you must either "Push, Pull or Get out of the way!"