SliTaz SliTaz Forum

You are not logged in.

#1 2011-04-23 12:31:01

vientito
Member
Registered: 2011-04-23
Posts: 3

syslog timestamp always in UTC

Ihave set up TZ accordingly but the timestamp recorded by syslogd is always displayed in UTC and not in localtime.  I have also tried to set my hardware clock to localtime but ti does not affect the display at all in the logging.

Is there anyway that I could make certain the timestamp is in localtime only???

Offline

#2 2011-04-23 16:42:34

merlin
Member
Registered: 2011-04-06
Posts: 81

Re: syslog timestamp always in UTC

There is a previous post that seems relevant to this issue.  For the record, I have the correct  TZ setting, but my time is still not always correctly displayed.  It seems that this should be easier.  Below is the copied and pasted previous post. I do not know how to reference it directly.

START OF PREVIOUS POST FROM FORUM

SLITAZ FORUM » ENGLISH SUPPORT » LIVE AND INSTALLATION

Time Setting (4 posts) (3 voices)

Started 3 weeks ago by xoanan

Latest reply from xoanan

Add this topic to your favorites (?)

Tags:

Time

xoanan

Member

Hi All

My system and hardware time are off; right now, its showing 00:24 am, when over here in CST, it's 7:24 pm. I have followed the guide;

Any thoughts?

POSTED 3 WEEKS AGO #

mojo

Member

root@slitaz:~# echo UTC+5 > /etc/TZ

POSTED 3 WEEKS AGO #

Trixar_za

Member

Install glibc-locale too. It comes with possible timezones. You can see them in /usr/share/zoneinfo and you can set it either how mojo described it or via "Red Spider Menu"---> System Tools ---> Control Box ---> Time tab by changing the Timezone box and clicking Change.

You can either copy the timezone from the directory into the main /usr/share/zoneinfo directory or you can add the directory to the thing what you add in the Timezone box. For example, I use /usr/share/zoneinfo/Africa/Windhoek as my TZ file, so in my Timezome box I have it added as Africa/Windhoek.

I hope that makes sense wink

POSTED 3 WEEKS AGO #

xoanan

Member

Thanx Guys! The advice seems to work! It now shows the correct time!

POSTED 2 WEEKS AGO #

END OF PREVIOIUS POST FROM FORUM

Offline

#3 2011-04-23 18:33:59

merlin
Member
Registered: 2011-04-06
Posts: 81

Re: syslog timestamp always in UTC

I seem to be able to set the correct time using as root the date command with the -s or --set option to set the time.  What seemed to work most recently is date -s hh:mm. Type date --help for usage.

Offline

#4 2011-04-23 19:04:10

vientito
Member
Registered: 2011-04-23
Posts: 3

Re: syslog timestamp always in UTC

i have nothing wrong with my system time.  I could get date in the right local time.  What I have problem is the /var/log/messages.  In that file, the timestamp is all in UTC, not local time.

My TZ=America/Montreal is in the right zone as well.  My hardware clock is stored in localtime as well.  Somehow the syslogd process likes to put the time in UTC instead of using the system time.

Offline

#5 2011-04-24 01:42:47

merlin
Member
Registered: 2011-04-06
Posts: 81

Re: syslog timestamp always in UTC

Sorry for my misunderstanding.  I don't think I can help you with that issue.

Offline

#6 2011-04-25 08:01:33

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: syslog timestamp always in UTC

I had the same issue with cron - see here:

http://vanilla.slitaz.org/index.php?p=/discussion/comment/12316#Comment_12316

try to run

TZ=Europa/Vienna (or whatever your timezone is)

when all startup is finished - if it still happens

Offline

#7 2011-04-25 15:35:41

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: syslog timestamp always in UTC

So it's probably a step at boot that we're missing. Shame there is no real guide on building a Linux from scratch hey? hmm

Offline

#8 2011-04-25 16:26:25

vientito
Member
Registered: 2011-04-23
Posts: 3

Re: syslog timestamp always in UTC

the setting of timezone is within i18n.sh.  In RcS the order of execution of i18n is left at the end, except in the case of fast-boot.

i try to kill off syslogd and restart it.  It seems to leave the right time in the message file when it got restarted yet all the other old processes such as cron and other daemons processes still leave UTC in the log file.  I wonder if I have to make sure TZ setting has to be placed before everything else in the boot process.

Offline

#9 2011-04-25 19:56:32

pankso
Administrator
Registered: 2026-06-27
Posts: 341
Website

Re: syslog timestamp always in UTC

Yep vientito nice touch, I guess you correct and there is no problem to move TZ settings in rcS itself

Trixar_za you may note I wrote the complet howto step by step about creation slitaz and at this time it was booting with only one script /etc/init.d/rcS (we could still do that but it woul be a too bit script to maintain). Note also that the Kernel boot, the it will look for /etc/inittab wich start rcS. You coul boot with 3-4 line in rcS, mount proc and root read/write and go... but at this stage you will get a us keybord, C/english locale and no timezone. It a distro desegin and choice after (slitaz is still damm simple 5 scripts to boot and finish, no runlevel and all the sysinti system) and I may be wrong when I splitted TZ seeting in i18n.sh since I also get wront date in cron/syslog

Offline

#10 2011-04-25 20:15:01

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: syslog timestamp always in UTC

@pankso I know, but there was no guide that you could reference. So SliTaz's distro building was (and still is) mainly trail and error.

Offline

#11 2011-04-25 20:47:18

pankso
Administrator
Registered: 2026-06-27
Posts: 341
Website

Re: syslog timestamp always in UTC

http://doc.slitaz.org/en:scratchbook:start

You read it and follwed it to have trail and errors ?

Offline

#12 2011-04-25 20:49:40

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: syslog timestamp always in UTC

Lol, I meant when you had to make SliTaz, there was no guide that you could use to reference your actions. So the building of SliTaz originally was (and still is) by trail and error. For example the configure options needed both for the Linux Kernel and Busybox. We're still learning, but that isn't a bad thing.

Offline

#13 2011-04-30 15:42:59

pankso
Administrator
Registered: 2026-06-27
Posts: 341
Website

Re: syslog timestamp always in UTC

Yep,

I did quiet a lot of commit in slitaz-boot-script, we now set the time zone in the begining of the first starte script aka rcS. This work only in /etc/TZ is not empty so not on first boot or live mode.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]