LinuxQuestions.org
Help answer threads with 0 replies.
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 03-07-2012, 08:55 AM   #1
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Rep: Reputation: 0
Query on Real-Time-Clock (RTC)


Hi all.

I require disabling all attempts of a Fedora user to modify system time.
I am thinking of disabling writing to RTC after the OS boots up; that way, no separate hacks per application will be needed.

Is that a sensible solution? If yes, what could be the cleanest implementation for this?
 
Old 03-07-2012, 09:05 AM   #2
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
Also, I get this seemingly strange behaviour of command-sequences ::

Code:
[ajay@ajay ~]$ ls -l /dev/rtc
lrwxrwxrwx. 1 root root 4 Mar  8  2012 /dev/rtc -> rtc0
[ajay@ajay ~]$ ls -l /dev/rtc
lrwxrwxrwx. 1 root root 4 Mar  8  2012 /dev/rtc -> rtc0
[ajay@ajay ~]$ sudo chmod 0555 /dev/rtc
[ajay@ajay ~]$ ls -l /dev/rtc
lrwxrwxrwx. 1 root root 4 Mar  8  2012 /dev/rtc -> rtc0
In other words, though the "chmod" runs (seemingly) without any errors, yet the permissions do not (seem to) take effect.

Why could this be happening?

Regards,
Ajay
 
Old 03-07-2012, 01:57 PM   #3
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
Well, I am able to change the permissions for "/dev/rtc0" (but not "/dev/rtc"); however, I am still able to change the time via

a. gnome-applet
b. ntpdate

 
Old 03-08-2012, 07:42 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897
There are two clocks, the system clock and the RTC or hardware clock. The RTC basically keeps time while the computer is off and at start up the OS will read the hardware clock to set the system clock. Both the gnome-applet and ntpdate change the system clock.
 
1 members found this post helpful.
Old 03-08-2012, 12:31 PM   #5
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
Thanks michaelk.

That was a lot of help; it helped me point to http://www.linuxsa.org.au/tips/time.html, and my understanding only got better; thanks

Just wanting a piece of guidance; I am actually wanting that no user should be able to change the time. One obvious solution is to prevent giving "sudo" previleges to the user. However, I am wondering, if a lower-level solution is possible?

Doing

Code:
sudo chmod 0555 /dev/rtc0
would prevent writing to the RTC; how can one do the same for system clock?

Thanks anyways. I am grateful for the pointers.


Regards,
Ajay
 
Old 03-08-2012, 01:03 PM   #6
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
I tried searching code for "hwclock" in "systemd" package (Fedora distro), in order to find the "keeper" of system-time; however, I find nothing there, except ::

Code:
[ajay@ajay systemd-10]$ grep -r -i -s "hwclock" .
./Makefile.in:	units/hwclock-load.service units/hwclock-save.service \
./Makefile.in:	units/hwclock-load.service units/hwclock-save.service \
./Makefile.am:	units/hwclock-load.service \
./Makefile.am:	units/hwclock-save.service \
./units/hwclock-load.service:ExecStart=/sbin/hwclock --systz
./units/hwclock-load.service:# Note the weird semantics if hwclock and the kernel here: the first
./units/hwclock-save.service:ExecStart=/sbin/hwclock --systohc
 
  


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
Real Time Clock & Real Time Timer jiramak Linux - Newbie 1 09-05-2007 06:43 PM
Real Time Clock on Compaq Armada M700? kailun Linux - Laptop and Netbook 1 09-16-2006 12:24 AM
Cannot Access my Real Time Clock? raid517 Linux - Hardware 1 05-08-2005 05:09 PM
Real Time Clock(RTC) problem gongcon Linux - Software 6 01-06-2005 09:36 PM
RTC time on a locally set clock pe2338 Debian 8 09-06-2003 04:30 AM

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

All times are GMT -5. The time now is 10:55 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