That means your "sudo" configuration doesn't allow the use of the `-E`
flag; at least in that specific use case. Alternatively, your system
doesn't preserve the value of `LD_LIBRARY_PATH` when the shell is invoked
via `sudo -E` because the shell's startup scripts clobber that var.

I hope you recognize this isn't a Go issue. You'll need to figure out how
to configure "sudo" on your system to meet your requirements and/or modify
the bash startup scripts for the root account not overwrite the value of
`LD_LIBRARY_PATH`.

On Mon, Jun 24, 2019 at 11:06 PM Nitish Saboo <nitish.sabo...@gmail.com>
wrote:

> Looks like it is still not preserving the env variable:
>
> nsaboo@ubuntu:~/Documents/goworkspace/src/poc$ export
> LD_LIBRARY_PATH=/usr/local/lib/syslog-ng
> nsaboo@ubuntu:~/Documents/goworkspace/src/poc$ sudo -E bash -c 'echo
> $LD_LIBRARY_PATH'
>
> nsaboo@ubuntu:~/Documents/goworkspace/src/poc$ echo $LD_LIBRARY_PATH
> /usr/local/lib/syslog-ng
> nsaboo@ubuntu:~/Documents/goworkspace/src/poc$
>

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD_4UC%3DWVK%3DVEka390%3D%2BQDqCrHXQ%2BtxrAm07OYJUMjNpAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to