Jail time/date settings

Status
Not open for further replies.

munificent

Explorer
Joined
Jul 3, 2012
Messages
54
I'm pretty sure I read somewhere that the jail has a different timezone to the main FreeNAS box. Is there any easy way to check this and change it if necessary? Googling it turned up some complex file edits revolving around building a jail from scratch but I can't believe that's necessary with FreeNAS.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I think that bug has been fixed. If you open a shell and go into the jail you can check the date.

Code:
jls

jexec JID csh

date

exit
exit
 

munificent

Explorer
Joined
Jul 3, 2012
Messages
54
Thank you Proto. Handy, if only to discover that the jail is one hour behind the actual time here in the UK. I guess Daylight Savings has something to do with it.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You can set the timezone in /etc/localtime by using the jexec command to go into the jail again. You might want to check what FreeNAS is set to and copy that. Before you do the jexec command, look at /etc/localtime, if that is wrong, check what you have set in the GUI.
 

munificent

Explorer
Joined
Jul 3, 2012
Messages
54
I think I'm just going to live with the hour time difference tbh. My enthusiasm for perfection only stretches so far. I appreciate the advice, I'm just going to be lazy!
 

Hanz001

Cadet
Joined
Sep 4, 2012
Messages
9
Hi protosd, sorry to be a burden but I'm a bit of a linux greenie. How exactly would I change the date/time & timezone in the jail to match the local installs date/time & timezone?

I under stand how to navigate around and mv, cp, set permissions etc... but these one off issues tend to stump me and believe me... I've looked around to find an answer before posting here. Feel free to point me in the right direction to learn a few more basics as well if you like.
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Hi Hanz001, I found the following helpful for step by step for us noobs (under set up timezone):

http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/

I copied the city file from /usr/share/timezone/Australia (in my case) to /etc/localtime and boom, my jail time had changed - too easy, we'll see if it survives a reboot :P

Hope that helps,
Chris
 

Hanz001

Cadet
Joined
Sep 4, 2012
Messages
9
Hi Hanz001, I found the following helpful for step by step for us noobs (under set up timezone):

http://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/

I copied the city file from /usr/share/timezone/Australia (in my case) to /etc/localtime and boom, my jail time had changed - too easy, we'll see if it survives a reboot :P

Hope that helps,
Chris

Chris,
Thanks for the reply. It worked great, but I just had to change a few things. For anyone else having trouble, do the following and it should work.

SSH in to your FreeNAS system or open the shell from within the FreeNAS web GUI and type the following. **This is assuming your jail # is 1 AND your zoneinfo is Los_Angeles** Feel free to substitute your own jail number and country folder and or city timezone file. Also for us n00bs, anything after a "#" symbol in the instructions below are just notes and should not be typed.

jexec 1 csh
cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime #this copies the zonefino file of your choosing and creates a localtime file in the /etc directory. Replace America/Los_Angeles with your country/continent and city.
date #this should now display your current date/time settings (which should now be correct).
exit #to exit the jail
exit #to exit the shell or ssh session


Hope this helps someone.
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
I issue has recently been addressed that will set the timezone in the jail the same as the host in jail startup. Expect a fix for 8.3 BETA2
 

SteelWolf

Dabbler
Joined
Jan 15, 2012
Messages
14
Just wanted to drop a note to say thanks to the folks in this thread - got my time set properly now.
 
Status
Not open for further replies.
Top