LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 02: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, 04:58 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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, 05: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, 05:22 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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


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


All times are GMT -5. The time now is 08:12 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration