frank at esperance-linux.co.uk
Tue Jul 22 17:14:27 BST 2003
On Tue, Jul 22, 2003 at 11:28:36AM +0100, Dominic Mitchell wrote:
> On Mon, Jul 21, 2003 at 06:19:28PM +0100, Frank Shute wrote:
> > On Mon, Jul 21, 2003 at 04:41:58PM +0100, Bruce M Simpson wrote:
> > >
> > > On Mon, Jul 21, 2003 at 03:25:45PM +0100, Frank Shute wrote:
> > > > I wanted to give root at localhost access to X which is launched by
> > > > frank at localhost.
> > >
> > > Try using unix domain sockets, by specifying -display :0.0 explicitly
> > > as root. Works fine for me... with both rxvt and xterm.
> > That's great. I su -l but it doesn't pick up $DISPLAY.
> That's deliberate. su -l will clear yuor environment in order to make
> it look like a fresh login.
> You might wish to investigate sudo if you just want to run the
> occasional X program as root. I find it very handy to be able to do
> "sudo ethereal" and have it work.
I use sudo but I wanted to launch the programs from an xterm where I'm
running as root.
What I've done is put this in root shell's rc:
TEST=$(ps ax | grep "bin\/X ")
if [ -z "$TEST" ]; then # no X
: # do nothing
if [ -z "$DISPLAY" ]; then # X but no $DISPLAY
echo "Set \$DISPLAY to $DISPLAY"
Bit of a bodge but then there's nothing quite as enjoyable as bodging
things up with shell :)
Tel: 01423 323019
PGP keyID: 0xC0B341A3
More information about the Ukfreebsd