*

Welcome, Guest. Please login or register.
Did you miss your activation email?

Puppy Linux Lucid 5.1 (lupu510) for the XO-1 is here!
Pages: [1]
Print
Author Topic: Using Sugar Control Panel to change Timezone  (Read 11797 times)

Using Sugar Control Panel to change Timezone

MGROSSIE
Commenter

Posts: 10


December 19, 2007, 02:00:24 PM

I followed instructions for changing the timezone on my laptop for the Wiki:
http://wiki.laptop.org/go/Sugar_Control_Panel#Usage
I want to change the timezone from America/New_York to America/Los_Angeles
In terminal, I typed: sugar-control-panel -s timezone America/Los_Angeles
And got this reply: Permission denied.  You need to be root to run this method
What more do I need to do?  I don't understand this.
Thanks.
Logged

#1 Re: Using Sugar Control Panel to change Timezone

eightbt
Commenter

Posts: 22



December 19, 2007, 04:42:05 PM

"You need to be root" means that you need to be logged in as the "root" user, who has the powers to control the universe (so be careful!)  When you start the terminal activity, you're running as the "olpc" user.

Conveniently, you can switch users while at the command prompt with the "su" command.  If you run it without any parameters, it will switch you to the root user.  You will notice that the prompt changes when this happens.  To return to the olpc user, just type "exit".
Logged

#2 Re: Using Sugar Control Panel to change Timezone

MGROSSIE
Commenter

Posts: 10


December 19, 2007, 08:15:22 PM

Worked perfectly.  YOU ROCK!  Thanks!
Grin
Logged

#3 Re: Using Sugar Control Panel to change Timezone

paz
Commenter

Posts: 18


December 26, 2007, 02:44:46 PM

My XO is configured to be at the timezone of America/New_York.  I am in the timezone of America/Chicago.

In Terminal, I entered su, which took me to the bash-3.2# prompt.  There I entered sugar-control -g timezone to check the timezone.  America/New_York was returned by the -g.

I entered sugar-control-panel -s timezone America/Chicago and struck enter.  The response was "sugar-control-panel:  [Errno 20} Not a directory: '/etc/localtime'.

I changed to the /etc and viewed a file localtime.  I ran the s-c-p again and was presented with the same error.

Anyone have any ideas? 

I am a remedial 'nix student, and I have lots of enthusiasm for anyone who has the patience.

Logged

#4 Re: Using Sugar Control Panel to change Timezone

osx424242
New

Posts: 1


December 27, 2007, 09:06:35 PM

I don't know what that error means, and I'm concerned that the error you posted means something is wrong with sugar or a related python file (and I'm new to the XO so don't know where to look), but if you can post some additional info it may help other people help you:

- have you installed any applications or made changes to any files?

- run the command again, copy-and-paste from here, and post the output:
sugar-control-panel -s timezone America/LosAngeles

- post the output of the following commands (which will verify that permissions (there is a very detailed description that I didn't bother to read on the Wikipedia 'permissions' page) are correct and then verify the contents ('cat' is short for 'concatenate' and if you just give it one filename it will display the contents of that file) are correct for some files that seem important to me, based on 'find' and Google):
ls -al /etc/localtime
cat /etc/localtime
ls -al /etc/sysconfig/clock
cat /etc/sysconfig/clock
ls -al /etc/timezone
cat /etc/timezone

If possible, type 'script' before doing any of these things and then type 'exit' when you're done, and just paste the contents of (or attach) the file 'typescript' which is created by the 'script' command ('script' will log everything you type as well as all the output, and by default places it into a file called 'typescript' in the directory from which you called 'script').
Logged

#5 Re: Using Sugar Control Panel to change Timezone

Ben James Ben
Senior Contributor
**
Posts: 142



December 28, 2007, 07:19:12 AM

[Deleted: sorry, what I posted previously was incorrect.]

I just tried the command "sugar-control-panel -s timezone America/Chicago" and it worked fine. I'm not sure what might be the cause of the problem paz is seeing.
« Last Edit: December 28, 2007, 07:48:06 AM by Ben James Ben » Logged

#6 Re: Using Sugar Control Panel to change Timezone

paz
Commenter

Posts: 18


December 28, 2007, 11:18:51 AM

I have the typescript file in place and I am struggling with viewing the data is a manner that will allow me to post it here.

I was able to view the contents of the file by typing "vi typescript".  What is presented is pretty much what I remember seeing as I typed the commands, along with a great number of ^M and ^H.

How can I get the data from this file into the clipboard so I can post it here?

Thanks
Logged

#7 Re: Using Sugar Control Panel to change Timezone

paz
Commenter

Posts: 18


December 28, 2007, 11:40:32 AM

I found that when using a scroll mouse you can copy selected text in the term with a left click and paste with a click of the scroll wheel

/script started on Sat Dec 29 07:46:31 2007
^[[?1034hbash-3.2# ls al /ect^H ^H^H ^Htc/localtime^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^Hs ^[[1@-^M
lrwxrwxrwx 1 root root 51 Dec 19 10:14 /etc/localtime -> ../usr/share/zoneinfo/America/Chicago/etc/localtime^M
bash-3.2# cat /etc/localtime^M
cat: /etc/localtime: Not a directory^M
bash-3.2# ls -al /etc/sysconfig/clock^M
ls: cannot access /etc/sysconfig/clock: No such file or directory^M
bash-3.2# ls -al /etc/sysconfig/clock^Mbash-3.2# ^[[9Pcat /etc/localtime^H ^H^H ^H^H ^H^H ^H^H ^H^H ^H^H ^H^H ^H^H ^Hsysconfig/clock^M
cat: /etc/sysconfig/clock: No such file or directory^M
bash-3.2# ls -al /etc/timezone^M
-rw-r--r-- 1 root root 4 Nov  2 12:00 /etc/timezone^M
bash-3.2# cat /etc/timezone^M
GMT^M
bash-3.2# exit^M

Script done on Sat Dec 29 07:50:58 2007
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
~                                                                                         
"typescript" 16L, 745C
Logged

#8 Re: Using Sugar Control Panel to change Timezone

Ben James Ben
Senior Contributor
**
Posts: 142



December 28, 2007, 12:35:28 PM

Tried to cleaned up the script output; hopefully it is accurate:
bash-3.2# ls -al /etc/localtime
lrwxrwxrwx 1 root root 51 Dec 19 10:14 /etc/localtime -> ../usr/share/zoneinfo/America/Chicago/etc/localtime
bash-3.2#

This looks wrong. It appears that someone tried to link /etc/localtime to /usr/share/zoneinfo/America/Chicago/etc/localtime which is a non-existent file. And, even more wrong is that it appears that /usr/share/zoneinfo/America/Chicago is no longer a time zone file but instead is a directory! Did you originally try to change the time zone from the command line, without using sugar-control-panel, perhaps on or about December 19th? It looks like someone botched the operation, erasing the Chicago time zone file.

You'll probably want to find out what happened to your Chicago time zone file and fix it. If your Chicago file was blown away, you will probably want to replace it with another copy. I believe that /usr/share/zoneinfo/US/Central is the same file as the one for Chicago. If this isn't correct or if that file is missing, you'll need to find a replacement somewhere else (another XO-1 laptop or other Linux system).

Don't run the below commands unless you know what you are doing. For those of you who do know what you are doing, I think that the below commands will fix paz's problem and also set the time zone to Chicago time. However, I haven't tested it, so proceed at your own risk.

Code:
# rmdir /usr/share/zoneinfo/America/Chicago/etc/localtime
# rmdir /usr/share/zoneinfo/America/Chicago/etc
# rmdir /usr/share/zoneinfo/America/Chicago
# rm /etc/localtime
# cp /usr/share/zoneinfo/US/Central /usr/share/zoneinfo/America/Chicago
# cp /usr/share/zoneinfo/America/Chicago /etc/localtime

[Edit: added below:]

After re-reading the problem, I'm not sure whether the Chicago time zone file was blown away or whether instead /etc/localtime was simply linked to a non-existent file. The output of "ls -lR /usr/share/zoneinfo/America/Chicago" would tell us whether or not this is so. If the problem is just improper linking, the fix would be (don't run the commands unless you know what you are doing!):

Code:
# rm /etc/localtime
# cp /usr/share/zoneinfo/America/Chicago /etc/localtime
« Last Edit: December 28, 2007, 12:43:09 PM by Ben James Ben » Logged

#9 Re: Using Sugar Control Panel to change Timezone

paz
Commenter

Posts: 18


December 28, 2007, 02:13:00 PM

Ben James Ben:

It was the linked to a non-existant file.  I checked the timezone info and the America/Chicago was still there.

Some of the time, I know what I'm doing and some of the time I don't.  The rest of the time I don't know I don't know what I'm doing, but continue on with expectations of pending doom or delight. 
I suspect that the creating a link to nowhere was one of those moments.

In the spirit of knowing, even at the risk of not, I went ahead and ran the commands:

# rm /etc/localtime
# cp /usr/share/zoneinfo/America/Chicago /etc/localtime

and, then:

sugar-control-panel -s timezone America/Chicago

then,

sugar-control-panel -g timezone

which produced America/Chicago

date showed me that the date and time were in error so I when hunting and came up with:

ntpdate pool.ntp.org

which, when I found a hot spot, created a connection and made the date and time all better.

Thanks ever so much for your analysis and directions. 
There is now a little bit less that I don't know and with any luck I will end the day at even.
Logged

#10 Re: Using Sugar Control Panel to change Timezone

decibel
Senior Contributor
**
Posts: 142



December 29, 2007, 12:47:46 PM

When I have the clock set for my time zone (Pacific) it ends up being an hour ahead. Is there a way to correct for Daylight Savings or manually set the time? I've only been able to see the time using the xclock and clock commands.
Logged

#11 Re: Using Sugar Control Panel to change Timezone

paz
Commenter

Posts: 18


December 30, 2007, 10:29:29 AM

decibel,

check this: http://swik.net/ntpdate
Logged

#12 Re: Using Sugar Control Panel to change Timezone

Frank Scott
Senior Contributor
**
Posts: 115


1st Hour Donor, Rocklin, CA


January 19, 2008, 03:32:56 PM



The best way I have found to set the clock is to go to root, then:

# hwclock --show

# hwclock --set --date "xx/xx/xx xx:xx:xx"

For example:

# hwclock --set --date "01/19/08 15:33:00"


Logged

#13 Re: Using Sugar Control Panel to change Timezone

thepete
Global Moderator
Master Contributor
****
Posts: 361


Day 1 Donor!!


WWW
January 24, 2008, 12:46:47 AM

Awesome instructions, Frank!  Thanks! (as always!)
Logged

Adventuring through the XOniverse!  It's a blast!

http://thetech.thepete.com

#14 Re: Using Sugar Control Panel to change Timezone

thepete
Global Moderator
Master Contributor
****
Posts: 361


Day 1 Donor!!


WWW
March 03, 2008, 01:33:01 AM

IN 656 I had to put /sbin/ in front of "hwclock" in 656 and that worked fine.

Then I had to reset the timezone to stop the XO from thinking the time was for EST.  I had to use MC to get into the /usr/share/zoneinfo/America/ directory just to see how the system spells Los Angeles. Tongue
Logged

Adventuring through the XOniverse!  It's a blast!

http://thetech.thepete.com
Pages: [1]
Print
Jump to:  

Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 05:28:43 AM

Login with username, password and session length
Recent Topics
[Today at 12:48:19 AM]

by anna
[September 08, 2010, 07:31:31 PM]

[September 08, 2010, 01:39:38 AM]

[September 07, 2010, 08:19:25 PM]

[September 06, 2010, 09:19:36 PM]

[September 05, 2010, 09:25:21 PM]

[August 30, 2010, 11:26:07 PM]

[August 30, 2010, 11:23:56 PM]

[August 30, 2010, 10:40:34 AM]

[August 28, 2010, 10:00:01 PM]
Members
Total Members: 4559
Latest: nikh105
Stats
Total Posts: 31138
Total Topics: 3760
Online Today: 71
Online Ever: 220
(February 05, 2009, 11:29:32 AM)
Users Online
Users: 1
Guests: 33
Total: 34