System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

To keep SHLIB_PATH environment

ozas
Advisor

To keep SHLIB_PATH environment

Hi, Pls do any one know how I can sudo to keep SHLIB_PATH environment on HP-UX
11 REPLIES
Jeeshan
Honored Contributor

Re: To keep SHLIB_PATH environment

Can you pls define your problem in details?
a warrior never quits
James R. Ferguson
Acclaimed Contributor

Re: To keep SHLIB_PATH environment

Hi:

If you mean that you lose the settings when you 'su' then you need to set:

SU_KEEP_ENV_VARS=SHLIB_PATH

...in '/etc/default/security'

See the manpages for 'security(4)'.

Regards!

...JRF...
ozas
Advisor

Re: To keep SHLIB_PATH environment

My problem in detail is that, I have sudo installed on HP-UX. This work perfectly well except for the mailbox services and the problem was that sudo does not keep the SHLIB_PATH environment. I have created the /etc/default/security and added SU_KEEP_ENV_VARS=SHLIB_PATH and also I have use the env_keep for all the global and local variables in the sudoers file but still does not work. Attahed is the error I get when the mailbox services are started. I will kindly appreciate any hint.
ozas
Advisor

Re: To keep SHLIB_PATH environment

Attachement
Dennis Handly
Acclaimed Contributor

Re: To keep SHLIB_PATH environment

>JRF: If you mean that you lose the settings when you 'su' then you need to set:
SU_KEEP_ENV_VARS=SHLIB_PATH

Wasn't the question about sudo?
Doesn't that need -E? (I had to use that since the default had changed.)
Jeeshan
Honored Contributor

Re: To keep SHLIB_PATH environment

if you wish to set SETENV in sudoers file

e.g.

user1 ALL = (root) NOPASSWD:SETENV:ALL
a warrior never quits
ozas
Advisor

Re: To keep SHLIB_PATH environment

Dennis, pls can you explain better.There was a syntax error when I use this
user1 ALL = (root) NOPASSWD:SETENV:ALL
Jeeshan
Honored Contributor

Re: To keep SHLIB_PATH environment

ozas
Advisor

Re: To keep SHLIB_PATH environment

Hi, I tried to edit the sudoers file to include:
Defaults always_set_home

It gives me the attached error when I restarted the mailbox services.
Dennis Handly
Acclaimed Contributor

Re: To keep SHLIB_PATH environment

>can you explain better.

sudo -E ...
http://www.gratisoft.us/sudo/man/sudo.html
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1358533

>unix_shell: you may check this link

That may be unrelated to the sudo issue.
ozas
Advisor

Re: To keep SHLIB_PATH environment

The environment issue has been resolved.
What I did differently was to add the following to the sudoers file:

Defaults env_keep -= "PATH"

Before now I was using +

Thanks to all the contributions.