Author Topic: (Solved) LX Terminal and su  (Read 865 times)

tedlane

  • Guest
(Solved) LX Terminal and su
« on: June 22, 2011, 07:10:34 AM »
This has got me puzzled.

If i run LXterminal and then su to gedit some /etc file, it fails as per this example:
[bb@townsend ~]$ su
Password:
[root@townsend bb]# gedit /etc/hosts
**
GLib-GIO:ERROR:gdbusconnection.c:2279:initable_init: assertion failed: (connection->initialization_error == NULL)
Aborted
[root@townsend bb]#


If I try it with geany it works OK.

Similarly, if I run the root terminal from the menu (i.e. the xvt script) then gedit works.

Any clues?
ted
« Last Edit: June 22, 2011, 07:37:27 AM by tedlane »

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12786
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: LX Terminal and su
« Reply #1 on: June 22, 2011, 07:16:59 AM »
Hey Dude.

Try

Code: [Select]
dbus-launch gedit /etc/hosts
Hope this helps.

Andy

Offline marcin82

  • Full Member
  • ***
  • Posts: 119
  • Metal is forever! // Yoda Królem Polski!
Re: LX Terminal and su
« Reply #2 on: June 22, 2011, 07:21:25 AM »
... or:
Code: [Select]
gksu gedit /ect/...
marcin82

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15845
  • LXDE! Coffee, Bacon and Cheesecake!
Re: LX Terminal and su
« Reply #3 on: June 22, 2011, 07:28:00 AM »
marcin82 has it right. Use --
Code: [Select]
gksu gedit /etc/hosts

tedlane

  • Guest
Re: LX Terminal and su
« Reply #4 on: June 22, 2011, 07:37:02 AM »
Thanks guys,

Yep they both work!

but I think the answer I really wanted was 'gksu xvt', which as usual was staring me in the face anyway  :-X

ted

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: (Solved) LX Terminal and su
« Reply #5 on: June 22, 2011, 01:21:36 PM »
Did a quick test here, and...

...while
Code: [Select]
sufails as described in the O-P...
Code: [Select]
su -works.
(Note the "space" and "dash" after "su").

Offline ericthered

  • Jr. Member
  • **
  • Posts: 30
  • Ex-distro hopper
Re: (Solved) LX Terminal and su
« Reply #6 on: June 22, 2011, 06:38:44 PM »
I know this is solved, but what about

Code: [Select]
su -c 'gedit /etc/hosts'

Offline pags

  • Hero Member
  • *****
  • Posts: 2519
  • Keep it clean.
Re: (Solved) LX Terminal and su
« Reply #7 on: June 22, 2011, 07:43:14 PM »
I know this is solved, but what about

Code: [Select]
su -c 'gedit /etc/hosts'

That failed...

Code: [Select]
suvs
Code: [Select]
su -is the difference between having a partial or full environment (variables, paths, etc)...
Code: [Select]
su -c geditdoesn't appear to have root's full environment...