LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-26-2016, 05:16 PM   #1
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Rep: Reputation: Disabled
Question root can't use X apps in su session


As I said in my other thread, I just came over to Slackware from Gentoo. When I was on Gentoo, I had cron run two backup scripts, one on the first of every month, and the other every single day. The first of the month script would back up the entire /etc and /home directories, while the everyday script would only back up files in those to directories that had changed since the previous day. All files are then dropped in /backup/<hostname>/YYYYMM/ and they are burned to a DVD four times a year. As one can imagine, it is vitally important when using a scheme such as this to keep archive sizes down so that the total doesn't go over 4.3GB. On Slack the /etc backup becomes less important, but the /home backup remains important. I keep a terminal open at all times with multiple tabs. One of those tabs is always running a su session. But when I try to run any X app, I get this:
root@caitlyn:~/gnumeric# file-roller
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
No protocol specified

** (file-roller:14811): CRITICAL **: Failed to parse arguments: Cannot open display:
root@caitlyn:~/gnumeric#

I have researched this some, and found no threads with similar enough circumstances to be helpful. I had this problem on RH almost twenty years ago, but have forgotten what the fix was. I have tried adding xhost +localhost to /home/michael/.bashrc in an attempt to workaround this issue, but it didn't work. Please help!
 
Old 12-26-2016, 05:32 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
I just add to my ~/.bashrc this line:
Code:
xhost local:
There are certainly better ways, but it works.
 
Old 12-26-2016, 06:07 PM   #3
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Original Poster
Rep: Reputation: Disabled
That worked. Thank you!!! Now how do I mark this thread [SOLVED]?

Last edited by maschelsea; 12-26-2016 at 06:11 PM.
 
Old 12-26-2016, 06:21 PM   #4
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,844

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
Click on Thread Tools at the top right of your first post. Solved is in the drop down box.
 
Old 12-26-2016, 07:00 PM   #5
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Original Poster
Rep: Reputation: Disabled
Thank you again.
 
Old 12-27-2016, 03:29 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
There are other options, if you don't want to manually specify that in your .bashrc. Namely, you can set the DISPLAY variable manually:

Code:
DISPLAY=:0
Also, I would suggest switching to kdesu instead of regular su to launch GUI programs as root within another user's session. Some programs will use the regular user's directory for their data, which can change the permissions or ownership of that data, causing the programs to have issues when run again as a regular user. This is easily solved after-the-fact using chown, but using kdesu will completely prevent it from occurring in the first place.
 
2 members found this post helpful.
Old 12-27-2016, 03:34 PM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks for the hint bassmadrigal !

I've never heard of kdesu until you mentioned it just now.

I suppose I need to RTFM more often.

Speaking of the fine manual, man kdesu has a nice synopsis of kdesu.

Thanks again !

-- kjh
 
Old 12-27-2016, 03:43 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
@bassmadrigal: Thanks also for the hint and the suggestion to use kdesu. By the way, people who do not have the KDE series installed or prefer not run KDE apps if there are other options can also use ktsuss or gksu, both available @ slackbuilds.org.
 
Old 12-27-2016, 05:08 PM   #9
worsel
Member
 
Registered: Feb 2008
Location: Washington State, USA
Distribution: Slackware 14.2, Slackware-from-Scratch
Posts: 241

Rep: Reputation: 45
Didier,

I just tried gksu and was quite dissatisfied. I compiled it to work in an
xterm per the instructions at Slackbuilds. When I tried to use it, it asked me
for my root password as expected, then ask for the password for "pulse", whatever
that is. When I tried again, it didn't as for the pulse password, but none of the
arrow keys would work. The keycodes for them were printed on the screen, but no
movement occured. I'm looking further into this. Maybe I left something out
but don't know what it could be at the moment.

Worsel
 
Old 12-27-2016, 05:40 PM   #10
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Worsel,

unfortunately I can't help here as I use ktsuss that is shipped in Slint. It doesn't have as many features as kdesu, buts suffices for my needs.

Last edited by Didier Spaier; 12-28-2016 at 10:56 AM.
 
Old 12-28-2016, 10:53 AM   #11
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
I use ktsuss here too, not very often, but when I need something like that its easily the quickest and simplest solution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
does anybody knows what this means? ptymonitor: pam_unix(login:session): session opened for user root by (uid=0) osalas Red Hat 3 08-15-2016 09:01 PM
Session key renegotiation if session lasts longer than configured (e.g. an hour) then session keys needs to be renegotiated. dakshinya Linux - Newbie 1 02-04-2016 04:15 PM
[SOLVED] Fluxbox how start up with same apps as previous session? porphyry5 Linux - General 3 06-25-2011 08:19 AM
[SOLVED] launching apps in wine only works in user session not in root ubume2 Linux - Newbie 7 09-25-2009 12:41 PM
Gnome session not displaying title bar for all apps kt8993 Fedora 1 09-10-2005 10:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration