LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2003, 01:55 PM   #1
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Rep: Reputation: 15
Xhost & DB2


I have recently installed and configured DB2 8.1 on my SUSE 8.2 distro. DB2 has a gui control center that can only be accessed by issuing the following commands:

xhost +
su - db2inst2
export DISPLAY=:0.0
exit
db2cc

I have done some reading in the MAN pages on xhost and I am little confused. I would like to know if there is a way modify the settings of xhost or xserver to allow users the ability to only issue one command (i.e. db2cc) without keying the xhost information.

I would also like to know more about what the DISPLAY variable means to me.

Thanks,
 
Old 10-16-2003, 03:58 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Basically what happens is that the program
needs to be run as this particular db2user.

However, since you didn't start your xsession
as this user, but rather as your "normal" user,
the other user by default can't display anything
on your xsession.

xhost + will allow ANY host that can network
to you to display stuff on your screen (which is
a bad idea in general :}) ... you can narrow that
down to
xhost +localhost
which will only allow people with accounts on your
machine to abuse your screen.

As for the DISPLAY, same thing applies... it's an
environment variable that tells X-programs where
to send their output. If you only did xhost + in the
script but didn't set display you'd get:
Error: can't open display.

HIH.

Cheers,
Tink
 
Old 10-16-2003, 04:06 PM   #3
byfaithalone
LQ Newbie
 
Registered: Sep 2003
Location: Little Rock, AR
Distribution: SUSE 8.2
Posts: 23

Original Poster
Rep: Reputation: 15
Great! I appreciate your feedback to my questions.
 
Old 10-16-2003, 04:22 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
As for the other question (sorry, I got carried away
with the first post ;)) ...

Just put the whole lot of commands into
a text file, call it e.g.
db2cc.sh
Code:
xhost +
su - db2inst2
export DISPLAY=:0.0
exit
db2cc
and then chmod it
Code:
chmod a+x db2cc.sh
Eh voila, there you go ;)

Cheers,
Tink
 
  


Reply



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
DB2 installation ,,,,,please... apenguinlinux Debian 6 07-28-2005 04:51 AM
[help] db2 v8 on FC4 kevinpan Linux - Software 0 07-11-2005 01:24 AM
disabling xhost & xauth Smokey Slackware 3 06-30-2005 04:02 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
DB2 & Java problem/ Please HELP! Bogdan Linux - Software 0 05-06-2002 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 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