setting bash variables for root

Hi

I’m trying to install netbeans 6.5 from the Sun installer. When I executed the script initially as root (using sudo) I got an error message that X11 DISPLAY variable was not set.

I followed instructions from here : Java/X11 Display Property Error - LinuxQuestions.org

and created a .bash_profile in my home directory, and added in:

DISPLAY=:0.0
export DISPLAY

Now when I launch the installer as end user the wizard gets started.

But I want to install as root, where and how do I include the above so that sudo will pick it up?

Thanks, David L.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Put the same line in /root/.bashrc (‘root’ user’s nome directory) to
have the same environment variable for the ‘root’ user:

export DISPLAY=:0.0

With that in mind you are setting this on your user so you can do the
install as ‘root’ already, so why do this for the root user in this
case? If you are using ‘sudo’ as you specified then you ARE doing the
install as ‘root’ already.

Good luck.

DavidLen wrote:
> Hi
>
> I’m trying to install netbeans 6.5 from the Sun installer. When I
> executed the script initially as root (using sudo) I got an error
> message that X11 DISPLAY variable was not set.
>
> I followed instructions from here : ‘Java/X11 Display Property Error -
> LinuxQuestions.org’ (http://tinyurl.com/57erkz)
>
> and created a .bash_profile in my home directory, and added in:
>
> DISPLAY=:0.0
> export DISPLAY
>
> Now when I launch the installer as end user the wizard gets started.
>
> But I want to install as root, where and how do I include the above so
> that sudo will pick it up?
>
> Thanks, David L.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJLYXP3s42bA80+9kRAh0iAJ9r2SLe/+Qf7ZXCjM0PbUFWsFJP5QCfdiGu
hBb8cCiBlf2pujYv72w9OIQ=
=hK+z
-----END PGP SIGNATURE-----

I’m sure that it’ll make sense to those that do understand the internals, but

  1. I was able to get the wizard launched from the user account
  2. I was not able to launch the wizard from a ‘sudo’ from the same account
  3. After making the changes to root’s file as specified, I used ‘su’ and then was able to lauch the wizard from root’s prompt

[QUOTE=ab@novell.com;1900566]-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Put the same line in /root/.bashrc (‘root’ user’s nome directory) to
have the same environment variable for the ‘root’ user:

export DISPLAY=:0.0

With that in mind you are setting this on your user so you can do the
install as ‘root’ already, so why do this for the root user in this
case? If you are using ‘sudo’ as you specified then you ARE doing the
install as ‘root’ already.

Good luck.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As long as it works… thank-you for posting back.

Good luck.

DavidLen wrote:
> I’m sure that it’ll make sense to those that do understand the
> internals, but
>
> 1. I was able to get the wizard launched from the user account
> 2. I was not able to launch the wizard from a ‘sudo’ from the same
> account
> 3. After making the changes to root’s file as specified, I used ‘su’
> and then was able to lauch the wizard from root’s prompt
>
> ab@novell.com;1900566 Wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Put the same line in /root/.bashrc (‘root’ user’s nome directory) to
>> have the same environment variable for the ‘root’ user:
>>
>> export DISPLAY=:0.0
>>
>> With that in mind you are setting this on your user so you can do the
>> install as ‘root’ already, so why do this for the root user in this
>> case? If you are using ‘sudo’ as you specified then you ARE doing the
>> install as ‘root’ already.
>>
>> Good luck.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJLaz83s42bA80+9kRApQgAJ41QCG/HYaPU2R9DIIE/VnzvSMijwCfTj45
IJaqE89wC9SuVP6T0vNwfYc=
=/28k
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Probably also worth mentioning you can usually just use ‘sux’ instead of
‘su’ though that is, I believe, a SUSE-specific toy.

sux -

Good luck.

ab@novell.com wrote:
> As long as it works… thank-you for posting back.
>
> Good luck.
>
>
>
>
>
> DavidLen wrote:
>> I’m sure that it’ll make sense to those that do understand the
>> internals, but
>
>> 1. I was able to get the wizard launched from the user account
>> 2. I was not able to launch the wizard from a ‘sudo’ from the same
>> account
>> 3. After making the changes to root’s file as specified, I used ‘su’
>> and then was able to lauch the wizard from root’s prompt
>
>> ab@novell.com;1900566 Wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Put the same line in /root/.bashrc (‘root’ user’s nome directory) to
>>> have the same environment variable for the ‘root’ user:
>>>
>>> export DISPLAY=:0.0
>>>
>>> With that in mind you are setting this on your user so you can do the
>>> install as ‘root’ already, so why do this for the root user in this
>>> case? If you are using ‘sudo’ as you specified then you ARE doing the
>>> install as ‘root’ already.
>>>
>>> Good luck.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJLa0m3s42bA80+9kRAszOAJ48wXRQO/Wox9EsqvjjsN53IjaJgwCdFMSE
jkGH0YlcN+DMaPHdk3n81/o=
=MKsP
-----END PGP SIGNATURE-----