LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-30-2020, 01:59 PM   #1
mstrimel
Member
 
Registered: Apr 2004
Location: USA
Distribution: Mint 19 Cinnamon
Posts: 75

Rep: Reputation: 0
UDEV rule for rtc: what am I doing wrong?


hi,
I need to durably change the permissions on /dev/rtc0 so that another user can write to it. Thus, I wrote a udev rule, ran "udevadm trigger" and rebooted. It did not work.
my custom udev file has one line, as follows:
Code:
ACTION=="ADD", ATTR{DEVNAME}=="/dev/rtc0", GROUP="mythtv", MODE="0666"
I saved it as /etc/udev/rules.d/40-rtc-permissions.rules

udevadm info returned the following name for my device:
Code:
/devices/pnp0/00:02/rtc/rtc
When I run
Code:
udevadm test /devices/pnp0/00:02/rtc/rtc
, I get a list of the rules being read, with my rule second on the list (that's good, right?), but then this:
Quote:
Invalid inotify descriptor.
DEVPATH=/devices/pnp0/00:02/rtc/rtc0
DEVNAME=/dev/rtc0
MAJOR=249
MINOR=0
ACTION=add
SUBSYSTEM=rtc
DEVLINKS=/dev/rtc
USEC_INITIALIZED=1681953
Unload module index
Unloaded link configuration context.
and the permissions still are incorrect. What am I doing wrong?
 
Old 10-31-2020, 07:15 AM   #2
mstrimel
Member
 
Registered: Apr 2004
Location: USA
Distribution: Mint 19 Cinnamon
Posts: 75

Original Poster
Rep: Reputation: 0
Well, I still don't know what was wrong, but after a bunch of fooling around here is the rule that works.
Code:
KERNEL=="rtc0", SUBSYSTEM=="rtc", KERNELS=="00:02", GROUP="mythtv", MODE="0666"
One trick was that apparently at least one of the match keys -- in my case, KERNELS -- must reference the parent device. To get the parent device attributes, you must run "udevadm info -a [yourdevice]". The section where the attributes are pluralized, like "KERNELS" vs. "KERNEL", relate to the parent.
Another thing is that you have to run udevadm control --reload-rules and udevadm trigger each time you change something, in order to test it properly with udevadm test.
I hope this helps someone!

Last edited by mstrimel; 10-31-2020 at 07:17 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RTC Alarm wakes up, even while BIOS has RTC alarm disabled mastermind2501 Linux - Newbie 2 12-22-2008 03:32 PM
2domain but backingup the wrong one .. what am i doing wrong salimmeethoo Linux - Server 3 10-17-2007 10:43 AM
udev rtc rules manwichmakesameal Linux - Kernel 3 01-23-2007 10:16 PM
/dev/rtc + udev in current dive Slackware 3 09-02-2006 09:37 PM
Wrong group with custom udev rule enragedchip Linux - Hardware 1 12-11-2005 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration