openhab / openhab-syno-spk

openHAB Synology SPK Install Package
Eclipse Public License 2.0
161 stars 42 forks source link

Wrong timezone in openhab on synology #5

Closed gorzan14 closed 8 years ago

gorzan14 commented 8 years ago

Hi, first thanks for the very nice sync-package! It works very fine. But today I discovered that openhab gets the wrong timezone (gmt +0) from my synology system, even at the synology admin gui everything is set right to gmt +1, Germany, german... sync with nap server. I was since months wondering why the time stamp in the logs is wrong. But today i intodruced the astro-binding and found that openhab has the wrong timezone:

2016-01-26 18:18:13.174 [INFO ] [.service.AbstractActiveService] - NTP Refresh Service has been started 2016-01-26 18:18:13.185 [INFO ] [.b.a.internal.bus.AstroBinding] - AstroConfig[latitude=51.28756,longitude=6.846684,interval=disabled,systemTimezone=GMT (GMT +0000),daylightSavings=false]

Interestingly when login in to my syno with ssh as root the the date command gives correct time

but locale command says this: Server1> locale LANG=en_US.utf8 LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL=en_US.utf8

Thus i supposes the locale is not set right by the system.

Has anybody the same behavior? Can I Set the default timezone for Openhab-core or the openhab-syno package? Didn't find something like this at the config files. I also wrote to synology!

Openhab 1.8.0, Java 1.7_60, DSM 5.2-5644 Update 3

mlava commented 8 years ago

https://community.openhab.org/t/synology-diskstation/1446/24

You can edit the start_runtime.sh to fix this.

gorzan14 commented 8 years ago

Thank you very much, Mark! Did work well.

Is it a Bug at the installscript or at the synology System?

Von meinem iPad gesendet

Am 26.01.2016 um 23:39 schrieb Mark Lavercombe notifications@github.com:

https://community.openhab.org/t/synology-diskstation/1446/24

You can edit the start_runtime.sh to fix this.

— Reply to this email directly or view it on GitHub.

mlava commented 8 years ago

@gorzan14 Hi, I'm glad it helped. I truly don't understand why the timezone preference in synology isn't replicated in openhab, as I don't understand linux servers all that well. I just did lots of googling and eventually found something that helped me :)

cniweb commented 8 years ago

Should I make this adjustment in start_runtime.sh script?

gorzan14 commented 8 years ago

@Christian

it would be a good idea to have it automatically set right after the install process.

I could test it.

p.s. other issue: do you think it could be an option to put the logs subfolder to the public folder when it exists like configurations? So when working remote on the configfiles one could see the openhab.stdout without ssh? maybe with tail -F public/logs/openhab.stdout?

Christian Häussler notifications@github.com hat am 28. Januar 2016 um 09:11 geschrieben:

Should I make this adjustment in start_runtime.sh script?

—
Reply to this email directly or view it on GitHub

https://github.com/cniweb/openhab-syno-spk/issues/5#issuecomment-176046285 .

gorzan14 commented 8 years ago

Maybe the Bug is in the openhab-syno-spk https://github.com/cniweb/openhab-syno-spk /scripts https://github.com/cniweb/openhab-syno-spk/tree/master/scripts /start-stop-status.sh line 24

grep "^${SYNO_TZ}" /usr/share/zoneinfo/Timezone/tzname

/usr/share/zoneinfo/Timezone/tzname does not exist! there exists a File /usr/share/zoneinfo/Timezone/tzlist

Maybe they changed it in the new DSM?

Christian Häussler notifications@github.com hat am 28. Januar 2016 um 09:11 geschrieben:

Should I make this adjustment in start_runtime.sh script?

—
Reply to this email directly or view it on GitHub

https://github.com/cniweb/openhab-syno-spk/issues/5#issuecomment-176046285 .

cniweb commented 8 years ago

@gorzan14 can you test it and send me your patched start-stop-status.sh?

Thanks

gorzan14 commented 8 years ago

@cniweb Im not that familiar with shell scripts. But i could try to change this file name. Where is this script located. I can't find it

gorzan14 commented 8 years ago

found it and testing

gorzan14 commented 8 years ago

@cniweb It works after changing tzname to tzlist at the start-stop-status.sh on my system: DS213j with DSM 5.2-5644 Update 3 I tested it two times. With changing back to the wrong filename i got the wrong time in OpenHAB

start-stop-status.sh.zip

cniweb commented 8 years ago

Thanks! I update in line 24 on the file https://github.com/cniweb/openhab-syno-spk/blob/master/scripts/start-stop-status.sh#L24 OK?

gorzan14 commented 8 years ago

@cniweb Yes. This is the right line. Do you think on other DS types or DSM versions there could be the other file name? So some one else gets a problem?

cniweb commented 8 years ago

I can test it on a DS101j (DSM 2.0), DS209 (DSM 4.2) and DS214play (DSM 5.2)!

gorzan14 commented 8 years ago

Should be enough! :-)

cniweb commented 8 years ago

I have add a new prerelease: https://github.com/cniweb/openhab-syno-spk/releases/tag/1.8.0.002 Please try, but do not test with DSM 6.0!

cniweb commented 8 years ago

@gorzan14 Could you try the package already?

gorzan14 commented 8 years ago

@cniweb today I could try it. It works fine with right timezone. thanks.

cniweb commented 8 years ago

OK, I am aware it for the 1.8.1 release. Can I close this Issue?

gorzan14 commented 8 years ago

Yes, close it.

Von meinem iPhone gesendet

Am 05.02.2016 um 14:05 schrieb Christian Häussler notifications@github.com:

OK, I am aware it for the 1.8.1 release. Can I close this Issue?

— Reply to this email directly or view it on GitHub.

LeoVe commented 8 years ago

Hi guys, thx for all the good work.

In line with what I think to read in this discussion, I added the parameter -Duser.timezone=Europe/Amsterdam to the java line in the file /start_runtime.sh and restarted, unfortunately the time in OpenHAB log still lags 1 hour. The time in the SSH terminal is OK. Any suggestions on what could be the case?

I'm using a Synology with DSM 5.2-5967 Update 1, Java 1.8.0-91 headless and Openhab vs 1.8.2 with zwave.

Thanks

gorzan14 commented 8 years ago

Please post your /start_runtime.sh

Did you stop and start with the Button at the Package Management gui of your DSM? I discovered once Problems restarting in Command line using the sh Script.

Von meinem iPhone gesendet

Am 30.05.2016 um 13:42 schrieb LeoVe notifications@github.com:

Hi guys, thx for all the good work.

In line with what I think to read in this discussion, I added the parameter -Duser.timezone=Europe/Amsterdam to the java line in the file /start_runtime.sh and restarted, unfortunately the time in OpenHAB log still lags 1 hour. The time in the SSH terminal is OK. Any suggestions on what could be the case?

I'm using a Synology with DSM 5.2-5967 Update 1, Java 1.8.0-91 headless and Openhab vs 1.8.2 with zwave.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

LeoVe commented 8 years ago

Thx gorzan14.

I always use the DSM package manager for starting and stopping.

The sh file as it is now (it includes a few statement for the usb zwave stick) is in the next comment.

LeoVe commented 8 years ago

Well it seems a bit deformed, maybe this is better: start_runtime.sh.txt

I think you set me on the right track gorzan, I think I did add the parameter a too far to the end of the line...

LeoVe commented 8 years ago

Wow, done gorzan14 :-) ! Moved the -D parameter a bit to the left in the commandline and the time is OK, thx !

gorzan14 commented 8 years ago

Ok. Fine. It works! But up to now i don't unterstand why After the Patch above the automatic Finding of Timezone dös not Work with the Package from here?

Von meinem iPhone gesendet

Am 30.05.2016 um 19:18 schrieb LeoVe notifications@github.com:

Wow, done gorzan14 :-) ! Moved the -D parameter a bit to the left in the commandline and the time is OK, thx !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

LeoVe commented 8 years ago

Prob because it's an installation from March ?

Met vriendelijke groet,

Leo Verkaik


Verkaik Advies Hindeloopenstraat 2 6835 KZ Arnhem

Web www.VerkaikAdvies.nl http://www.verkaikadvies.nl Tel. 026 3274264 Mob. 0618 882560 Fax 026 3274781

Op 30 mei 2016 om 20:58 heeft gorzan14 <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

Ok. Fine. It works! But up to now i don't unterstand why After the Patch above the automatic Finding of Timezone dös not Work with the Package from here?

Von meinem iPhone gesendet

Am 30.05.2016 um 19:18 schrieb LeoVe <notifications@github.com mailto:notifications@github.com >:

Wow, done gorzan14 :-) ! Moved the -D parameter a bit to the left in the commandline and the time is OK, thx !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.