Opened 9 years ago

Closed 9 years ago

Last modified 21 months ago

#5819 closed defect (fixed)

Can't set timezone with control panel with login shell (su -)

Reported by: kimquirk Owned by: erikos
Priority: normal Milestone:
Component: other-activity Version:
Keywords: Cc: cscott
Blocked By: #5537 Blocking:
Deployments affected: Action Needed:
Verified: no


Build 650

Go into terminal activity and try to set timezone with:
sugar-control-panel -s timezone America/Los_Angeles

And it says you need to be root.
If I set su - first; then the error message is: RuntimeError "the SUGAR_PATH environment is not set".

I'm not asking to fix it on 650; but I'm wondering how it worked earlier and stopped in 650; and to make sure it works in the next release, Update1.

Change History (11)

comment:1 Changed 9 years ago by blahedo

This is more or less a dup of #5547, although I'll note that if you type "su" by itself, without the hyphen that triggers a full login shell, it works ok.

comment:2 Changed 9 years ago by erikos

  • Priority changed from blocker to normal
  • Summary changed from Can't set timezone with control panel to Can't set timezone with control panel with login shell (su -)

If you use su by itself without hyphen it will work fine - as blahedo says this does not trigger the login shell (which looses the SUGAR_PATH). su by itself always worked i noted how to become root here:

#5537 is handling how to preserve the SUGAR_PATH for the sudo command which seems to be the new way of handling to become root privileges.

So I think this is not a blocker anymore since we have a working way.

comment:3 Changed 9 years ago by erikos

  • Resolution set to fixed
  • Status changed from new to closed

We use sudo now to get root privileges we need for certain commands. The sudo command which preserves the SUGAR_PATH went into joyride and update-1 (tested in 1525 and update.1-679) and the following command should now be used to set the timezone:

sudo sugar-control-panel -s timezone [timezone]

comment:4 Changed 9 years ago by chihyu

  • Resolution fixed deleted
  • Status changed from closed to reopened

tested with joyride 1537, still failed.

  • Hit ctrl-alt-mesh
  • Hit Enter to login (as root)
  • Type sudo sugar control-panel -s timezone America/New_York, returns the following error message:
     File "/usr/bin/sugar-control-panel", line 26, in <module>
       sys.path.insert(0, env.get_shell_path())
     File "/usr/lib/python2.5/site-packages/sugar/", line 90, in get_shell_path
       return _get_sugar_path('shell', path)
     File "/usr/lib/python2.5/site-packages/sugar/", line 36, in _get_sugar_path
       raise RuntimeError("The SUGAR_PATH environment variable is not set.")
    RuntimeError: The SUGAR_PATH environment variable is not set.
  • Type sugar control-panel -s timezone America/New_York returns the same message.

comment:5 Changed 9 years ago by erikos

You are using the virtual console i guess. In the virtual console you are logged in as root and the SUGAR_PATH is not set. You should use the Terminal for these commands (tested in 680 as working). I am not sure setting the SUGAR_PATH works for the virtual console, I think Bernie and m_stone did the work with the auto-login.

comment:6 Changed 9 years ago by cscott

  • Cc cscott added

Let's keep an eye on this as #5537 changes back to su.

comment:7 Changed 9 years ago by erikos

  • Blocked By 5537 added
  • Keywords jg removed

comment:8 Changed 9 years ago by erikos

'export SUGAR_PATH=/usr/share/sugar' if you want to use s.c.p in the virtual console. With the sugar rework the SUGAR_PATH is no longer required - but this will probably go into Update.2.

You are all good when you use sudo if you need to set settings using root privileges and invoke the command in the terminal activity - i would say this is the recommended way. If you invoke for example 'sugar-control-panel language' as root - the /root/.i18n file will be used since the code relies on $HOME :/

comment:9 Changed 9 years ago by cscott

Is this bug still open? I'm pretty sure the sudo and wiki instruction changes fixed this?

comment:10 Changed 9 years ago by erikos

  • Resolution set to fixed
  • Status changed from reopened to closed

This is fixed in current joyride. You can use the s.c.p from the virtual console. It woun't work as root.

comment:11 Changed 21 months ago by Quozl

  • Milestone Update.1 deleted

Milestone Update.1 deleted

Note: See TracTickets for help on using tickets.