linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Permissions question with reboots and udev
@ 2006-11-13 16:15 Kilau, Scott
  2006-11-13 18:22 ` Greg KH
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-13 16:15 UTC (permalink / raw)
  To: linux-hotplug

(Resending to list, first time it got rejected as spam...)

Hi everyone,
Sorry to bug again.

 
Another quick question that probably has a quick answer.
 
One of the big "issues" our (Digi's) serial port users seem to always
have is
having permissions and ownership of their ttys preserved across reboots.
 
With non-udev, I wrote a script that would update the major values of
their
existing "Digi" tty entries in /dev, while maintaining the current
permissions/ownerships
across reboots.
 
With udev, I am unsure if there is any way to do this...
 
As far as I can tell, if someone does something like:
 
chown uucp:uucp /dev/ttya01
 
Then reboots the system, (or even reloads the driver),
the devices get blown away, and recreated, and end up back as root:root.
 
I know you can specify a udev rule to create the devices as a specific
permission/ownership,
but that is a sledgehammer approach to it...
 
I am thinking I could make a rule to ignore "removal" on my devices,
which I suspect
will allow me to keep to the ttys around in /dev, but I am stumped on
making a "rule"
to  "preserve" the existing permission/ownership when/if the device gets
readded...
 
Any ideas? Thoughts?
 
Thanks!
Scott Kilau
 
 
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Permissions question with reboots and udev
  2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
@ 2006-11-13 18:22 ` Greg KH
  2006-11-13 19:50 ` Kilau, Scott
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2006-11-13 18:22 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Nov 13, 2006 at 10:15:56AM -0600, Kilau, Scott wrote:
> (Resending to list, first time it got rejected as spam...)
> 
> Hi everyone,
> Sorry to bug again.
> 
>  
> Another quick question that probably has a quick answer.
>  
> One of the big "issues" our (Digi's) serial port users seem to always
> have is
> having permissions and ownership of their ttys preserved across reboots.
>  
> With non-udev, I wrote a script that would update the major values of
> their
> existing "Digi" tty entries in /dev, while maintaining the current
> permissions/ownerships
> across reboots.
>  
> With udev, I am unsure if there is any way to do this...
>  
> As far as I can tell, if someone does something like:
>  
> chown uucp:uucp /dev/ttya01
>  
> Then reboots the system, (or even reloads the driver),
> the devices get blown away, and recreated, and end up back as root:root.
>  
> I know you can specify a udev rule to create the devices as a specific
> permission/ownership,
> but that is a sledgehammer approach to it...

Why do you think so?

> I am thinking I could make a rule to ignore "removal" on my devices,
> which I suspect
> will allow me to keep to the ttys around in /dev, but I am stumped on
> making a "rule"
> to  "preserve" the existing permission/ownership when/if the device gets
> readded...
>  
> Any ideas? Thoughts?

Just add a udev rule that sets the correct owner:group for your devices.
That's what the distros do for all other devices.

Hope this helps,

greg k-h

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Permissions question with reboots and udev
  2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
  2006-11-13 18:22 ` Greg KH
@ 2006-11-13 19:50 ` Kilau, Scott
  2006-11-13 20:06 ` Ken Brush
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-13 19:50 UTC (permalink / raw)
  To: linux-hotplug

Hi Greg,

Thanks for responding! 

> Just add a udev rule that sets the correct owner:group for 
> your devices.
> That's what the distros do for all other devices.

The problem is that I have no idea upfront what someone might
use our tty devices for.

For example, someone might use "ttyxyz" for an app that requires
the ownership to always be "uucp:uucp", and someone else might
need it to be "root:root", while yet another might need "root"lp".

Obviously, if the user is udev-savvy enough, they can go
create their own udev rule, and the problem is solved.

But the problem is, most users just aren't udev savvy...
(Nor do I think they should be).

Most people usually just chmod/chown the device once and
expect it to stay that way across reboots, or they put the
chmod/chown in rc.local that does it...

(I guess you could argue if they know how to mod rc.local,
they should know how to create a udev rule...)

I was just hoping there might be a simple way to preserve the
values of the chmod/chown of devices across reboots, but it
looks like there isn't.

BTW,
Another thing which is killing me...

Did you know Red Hat is still shipping udev 039 for Red Hat Enterprise
4?

There is something really wrong with it when adding 32+ tty devices at
once.

Fedora Core 4, 5 and 6 with newer udevs do not have the problem.

Just thought you would be interested...

(I filled out a Bugzilla about it already):
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id!5379

Thanks again for your response!
Scott Kilau

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Permissions question with reboots and udev
  2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
  2006-11-13 18:22 ` Greg KH
  2006-11-13 19:50 ` Kilau, Scott
@ 2006-11-13 20:06 ` Ken Brush
  2006-11-14 16:52 ` FW: " Kilau, Scott
  2006-11-14 21:40 ` Dan Nicholson
  4 siblings, 0 replies; 6+ messages in thread
From: Ken Brush @ 2006-11-13 20:06 UTC (permalink / raw)
  To: linux-hotplug

On 11/13/06, Kilau, Scott <Scott_Kilau@digi.com> wrote:
> Hi Greg,
>
> Thanks for responding!
>
> > Just add a udev rule that sets the correct owner:group for
> > your devices.
> > That's what the distros do for all other devices.
>
> The problem is that I have no idea upfront what someone might
> use our tty devices for.
>
> For example, someone might use "ttyxyz" for an app that requires
> the ownership to always be "uucp:uucp", and someone else might
> need it to be "root:root", while yet another might need "root"lp".
>
> Obviously, if the user is udev-savvy enough, they can go
> create their own udev rule, and the problem is solved.
>
> But the problem is, most users just aren't udev savvy...
> (Nor do I think they should be).

This is why you have a sysadmin, usually. To change udev rules for the
machine to be correct.

What user would have permission to chown a device?
Why would a device need to be chown'd or chmod'd multiple times?

> Most people usually just chmod/chown the device once and
> expect it to stay that way across reboots, or they put the
> chmod/chown in rc.local that does it...
>
> (I guess you could argue if they know how to mod rc.local,
> they should know how to create a udev rule...)

(Yes)

> I was just hoping there might be a simple way to preserve the
> values of the chmod/chown of devices across reboots, but it
> looks like there isn't.

Shutdown script that maps your whole dev tree and then replays it.
K00preserve-dev-perms = this would do the collection
S99restore-dev-perms = this would chmod/chown everything afterwards

Btw, I bet there would be problems with that.

-Ken

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* FW: Permissions question with reboots and udev
  2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
                   ` (2 preceding siblings ...)
  2006-11-13 20:06 ` Ken Brush
@ 2006-11-14 16:52 ` Kilau, Scott
  2006-11-14 21:40 ` Dan Nicholson
  4 siblings, 0 replies; 6+ messages in thread
From: Kilau, Scott @ 2006-11-14 16:52 UTC (permalink / raw)
  To: linux-hotplug


(Oops, forgot to CC the list as well.)

Hi Ken,
 
> This is why you have a sysadmin, usually. To change udev rules for the
> machine to be correct.

Sorry, when I say user, I actually do mean sysadmin/root.

> Why would a device need to be chown'd or chmod'd multiple times?

The problem is on reboot, the device gets blown away from /dev,
and then recreated on boot up.

So if root does a "chown uucp:uucp /dev/ttyxyz", then rebooted
the system, when the system came back up, the /dev/ttyxyz device
would come back up as "root:root", unless they made a custom
udev rule for the device...

> Shutdown script that maps your whole dev tree and then replays it.
> K00preserve-dev-perms = this would do the collection
> S99restore-dev-perms = this would chmod/chown everything afterwards

This might have potential.

I could just have it map my drivers tty devices, and then replay just
those on "restore".
Since it would be just my devices, it shouldn't be too laggy/boggy...

Thanks for the idea! It might be worth a shot for me!

Scott Kilau

-------------------------------------------------------------------------
SF.net email is sponsored by: A Better Job is Waiting for You - Find it Now.
Check out Slashdot's new job board. Browse through tons of technical jobs
posted by companies looking to hire people just like you.
http://jobs.slashdot.org/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: FW: Permissions question with reboots and udev
  2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
                   ` (3 preceding siblings ...)
  2006-11-14 16:52 ` FW: " Kilau, Scott
@ 2006-11-14 21:40 ` Dan Nicholson
  4 siblings, 0 replies; 6+ messages in thread
From: Dan Nicholson @ 2006-11-14 21:40 UTC (permalink / raw)
  To: linux-hotplug

Accidentally replied only to Scott the first time.

On 11/14/06, Kilau, Scott <Scott_Kilau@digi.com> wrote:
>
> >
> > That's the way udev works, though. Writing a custom rule is pretty
> > simple. If you know the attributes of your device, just tell them how
> > to write a custom rule with OWNER and GROUP. You could even ship a
> > custom rule matching your device that's commented out and tell them to
> > uncomment and fill in the values they want for the owner and group.
> > Use udevtest, udevinfo and udevmonitor to find out what the attributes
> > to match are.
>
> Thanks for your response!
>
> Oh, the problem isn't that I can't write the rules,
> I think I have almost memorized all the text on that
> web page by now. =)
>
> The problem is that non-driver/non-udev people that have
> no idea what udev is...
>
> Udev is a vast departure away from every "current" Unix/Linux
> in that the devices get blown away from /dev without
> saving ownership/permisssions on a reboot.

Well, if they're sysadmins running a modern Linux system, I'd hope
they'd figure out what the device creation scheme is on their system.
Maybe that's a harsh view, but I don't see how editing a file in
/etc/udev/rules.d is different than tuning any of the other myriad
configuration files in /etc. Udev _is_ the system that's used to
create persistence in the /dev hierarchy across boots on Linux.

> I was just hoping that "udev" was still a work in progress,
> and that this reboot "issue" was just something that is
> "still in the works".
>
> If not, like you say, we can just write a FAQ explaining how
> to create a udev rule, and maybe ship an example one as well.

I think that's just the way it's gonna be. Udev is not going away any
time soon on Linux, I don't think. I don't know what you're device is,
but surely there are going to be sysfs attributes that identify your
device. You can even ship a rule that is on by default with
OWNER="root", GROUP="root", MODE="0660" (the defaults) and the FAQ
will simply be "Edit /etc/udev/rules.d/80-digi.rules if you'd like to
change the permissions/ownership of your device."

The alternative of shipping a script with a configuration file and a
udev rules file that ensures the script is run seems like overkill.

Hope that helps. Good luck with your driver.

--
Dan

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-14 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13 16:15 Permissions question with reboots and udev Kilau, Scott
2006-11-13 18:22 ` Greg KH
2006-11-13 19:50 ` Kilau, Scott
2006-11-13 20:06 ` Ken Brush
2006-11-14 16:52 ` FW: " Kilau, Scott
2006-11-14 21:40 ` Dan Nicholson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).