Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/localtime being ignored...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Mon Mar 26, 2007 7:24 am    Post subject: /etc/localtime being ignored... Reply with quote

Hi!

I have a wierd problem with time in my office computer, I cannot set my timezone (CET) as I always did (and as it's working in my home gentoo box), take a look:

Quote:

javierruiz jruiz # rm -rf /etc/localtime && ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime
javierruiz jruiz # date
Mon Mar 26 08:20:16 GMT 2007
javierruiz jruiz # rm -rf /etc/localtime && ln -sf /usr/share/zoneinfo/CET /etc/localtime
javierruiz jruiz # date
Mon Mar 26 08:20:27 GMT 2007


(Also tried copying instead of linking...)

8O

and this is my /etc/conf.d/clock (included in the boot runlevel):
Quote:

# /etc/conf.d/clock

# Set CLOCK to "UTC" if your system clock is set to UTC (also known as
# Greenwich Mean Time). If your clock is set to the local time, then
# set CLOCK to "local". Note that if you dual boot with Windows, then
# you should set it to "local".

CLOCK="UTC"

# Select the proper timezone. For valid values, peek inside of the
# /usr/share/zoneinfo/ directory. For example, some common values are
# "America/New_York" or "EST5EDT" or "Europe/Berlin".

TIMEZONE="Europe/Madrid"

# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here.

CLOCK_OPTS=""

# If you want to set the Hardware Clock to the current System Time
# during shutdown, then say "yes" here.

CLOCK_SYSTOHC="yes"


### ALPHA SPECIFIC OPTIONS ###

# If your alpha uses the SRM console, set this to "yes".
SRM="no"

# If your alpha uses the ARC console, set this to "yes".
ARC="no"


I also tried CLOCK="Local" and TIMEZONE="CET" but still the timezone is unchanged...

Does anybody know about this?

Thanks!
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Mon Mar 26, 2007 11:04 am    Post subject: Reply with quote

If this is a fairly uptodate Gentoo, then /etc/localtime has probably been deprecated.

I preferred that, but for some reason now you're forced to set the Timezone in the /etc/conf.d/clock

I notice you tried changing the settings in there too (BTW, leave CLOCK as UTC if your BIOS is using UTC time!) - After you set them, did you restart /etc/init.d/clock?
Back to top
View user's profile Send private message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Mon Mar 26, 2007 11:11 am    Post subject: Reply with quote

Yep, tried restarting with the init script and even restarting computer (windows style lol) but timezone is still in GMT :?

Quote:
If this is a fairly uptodate Gentoo, then /etc/localtime has probably been deprecated.


8O didn't know that... thanks for the info
Back to top
View user's profile Send private message
Carlo
Developer
Developer


Joined: 12 Aug 2002
Posts: 3356

PostPosted: Mon Mar 26, 2007 11:39 am    Post subject: Reply with quote

Cyker wrote:
If this is a fairly uptodate Gentoo, then /etc/localtime has probably been deprecated.

Definitely not. Please don't spread misinformation, even if you weaken your statement, using "probably". It leads only to confusion and whatnot.

The TIMEZONE variable has been added, to copy the correct timezone file to /etc/localtime, when installing sys-libs/timezone-data (or running emerge --config sys-libs/timezone-data-<version>), since symlinking it isn't a good idea, when /usr resides on a different partition. This is, unless you deliberately choose to use a symlink.
_________________
Please make sure that you have searched for an answer to a question after reading all the relevant docs.
Back to top
View user's profile Send private message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Mon Mar 26, 2007 12:57 pm    Post subject: Reply with quote

thanks for the important note Carlo...

with that information, I tried what it seems to be the proper way to set the timezone:
1 - Fixed my settings in the /etc/conf.d/clock
2 - Used emerge --config with the installed ebuild to generate /etc/localtime

but still no luck... :x

look:
Quote:
javierruiz jruiz # equery list timezone-data
emer[ Searching for package 'timezone-data' in all categories among: ]
* installed packages
ge -[I--] [ ~] sys-libs/timezone-data-2007d (0)
-javierruiz jruiz # emerge --config =sys-libs/timezone-data-2007d


Configuring pkg...

* Updating /etc/localtime with /usr/share/zoneinfo/CET

javierruiz jruiz # date
Mon Mar 26 12:51:49 GMT 2007


:x :x :x

.
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Mon Mar 26, 2007 6:24 pm    Post subject: Reply with quote

Carlo wrote:
Cyker wrote:
If this is a fairly uptodate Gentoo, then /etc/localtime has probably been deprecated.

Definitely not. Please don't spread misinformation, even if you weaken your statement, using "probably". It leads only to confusion and whatnot.

The TIMEZONE variable has been added, to copy the correct timezone file to /etc/localtime, when installing sys-libs/timezone-data (or running emerge --config sys-libs/timezone-data-<version>), since symlinking it isn't a good idea, when /usr resides on a different partition. This is, unless you deliberately choose to use a symlink.


Ahh, if that's the case that would explain why it stopped working on mine.

When I did my first "emerge -av world" after building a base 2006.1 install and then rebooted, I was getting this error about timezone being set to FACTORY and that I needed to change it in the conf.d/clock. When I checked my time it had been set to UTC instead of UTC+1 (Which was the zone I was in) even 'tho the localtime was apparently symlinked properly.

All the docs I'd seen when I did a search on this stated that you should set the TIMEZONE in the clock and not to copy/symlink them the zone file like you used to do, so I just assumed doing it that way had been deprecated in favour of the conf.d/clock setting. I didn't realise you could still use /etc/localtime, since it stopped working on mine.

And apologies if I've offended you in some way; This wasn't a deliberate 'spreading of misinformation', just what I'd inferred from previous experience and lack of contrary information.

Thanks for the correction!
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Tue Mar 27, 2007 4:12 pm    Post subject: Reply with quote

From your /etc/conf.d/clock
Quote:
CLOCK="UTC" . Shouldnt that be "local" ?

_________________
An A-Z Index of the Linux BASH command line
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Tue Mar 27, 2007 4:42 pm    Post subject: Reply with quote

It should only be local if you need to dual-boot with Windows. Storing the time in UTC doesn't mean that it should display in UTC--the system converts it for you before displaying it.
Back to top
View user's profile Send private message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Tue Mar 27, 2007 4:54 pm    Post subject: Reply with quote

well I'm not quite sure if I understood well the purpose of the CLOCK variable, maybe this is a good time to learn :D
as I understand, setting "Local" or "UTC" is just to tell the OS that your hardware clock is set to the UTC (gmt) or directly your timezone local time, what for me means: I'm on CEST now (central european summer time, what means gmt+2h), so if my hardware clock is set to 14:00h and I have CLOCK=UTC, then my system will get it's 16:00h CEST, but if I set CLOCK=Local, my system gets it's 14:00h CEST. With this, I understand that the CLOCK variable is not a part of my problem, since my problem is that I can't tell my system I'm on CEST!
(I'd appreciate corrections on this...)

Anyway, I can tell you I tried both settings (even restarting gentoo after changing) and neither the OS time nor the timezone got changed :( it always displays GMT
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Tue Mar 27, 2007 5:33 pm    Post subject: Reply with quote

Would you like to run
Code:
strace date
it will show all the files it accesses and this might give a clue as to why it is sticking to GMT.

It's dev-util/strace.
_________________
The avatar is jorma, a "duck" from "Elephants Dream": the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details.
Back to top
View user's profile Send private message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Wed Mar 28, 2007 8:00 am    Post subject: Reply with quote

aaaah!! I can't believe I was so stupid on this!!

strace didn't show me the file that was causing the problem, but it did remind me about something I did recently that is the timezone problem I was having...

strace shown (just a relevant piece):
Quote:

open("/opt/oracle/product/10.2.0.1.0/lib/tls/i686/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/tls/i686/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/tls/i686/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/tls/i686", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/tls/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/tls/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/tls", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/i686/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/i686/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/i686/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/i686", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/tls/i686/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/tls/i686/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/tls/i686/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/tls/i686", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/tls/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/tls/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/tls/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/tls", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/i686/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/i686/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/i686/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/i686", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/sse2/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32/sse2", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/opt/oracle/product/10.2.0.1.0/lib32/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/oracle/product/10.2.0.1.0/lib32", 0xbfef49e4) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=112130, ...}) = 0

...



I recently installed Oracle10g for testing locally my developments... then I remembered that during installation, some env vars were needed, so... cat /etc/env.d/99oracle

Quote:
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/10.2.0.1.0
ORACLE_SID='JRuizSys'
ORACLE_TERM=xterm
ORACLE_OWNER=oracle
TNS_ADMIN=/opt/oracle/product/10.2.0.1.0/network/admin
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
ORA_NLS10=/opt/oracle/product/10.2.0.1.0/nls/data
ORA_NLS33=/opt/oracle/product/10.2.0.1.0/nls/data
CLASSPATH=/opt/oracle/product/10.2.0.1.0/jdbc/lib/classes12.zip
LD_LIBRARY_PATH=/opt/oracle/product/10.2.0.1.0/lib:/opt/oracle/product/10.2.0.1.0/lib32
DISABLE_HUGETLBFS=1
PATH=/opt/oracle/product/10.2.0.1.0/bin
ROOTPATH=/opt/oracle/product/10.2.0.1.0/bin
LDPATH=/opt/oracle/product/10.2.0.1.0/lib:/opt/oracle/product/10.2.0.1.0/lib32
TZ=GMT


yes... TZ=GMT ... it was myself who forced the system to be on GMT... shame on me :oops:

anyway there is an interesting point in this, it seems that the TZ variable overwrites the setting of /etc/localtime and any other "timezone setter"... easy to demonstrate:

Code:

$ TZ=CET date
Wed Mar 28 10:53:33 CEST 2007

$ TZ=EST date
Wed Mar 28 03:53:40 EST 2007

$ TZ=GMT date
Wed Mar 28 08:53:49 GMT 2007


thanks guys for your support!
Back to top
View user's profile Send private message
jruiz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 100
Location: Asturias

PostPosted: Wed Mar 28, 2007 8:03 am    Post subject: Reply with quote

BTW... in the list of files shown by strace there are also attempts to access files from removed installations of Lotus Notes... why is the "date" command trying to access my (aready removed) oracle and lotus notes files? can I do something to avoid this?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum