Hi everyone,
I was trying to install a package using sudo pkg_add -r <pkgname> and I noticed that pkg_add(1) was not using the PACKAGESITE variable that I had set in my .cshrc file. In order to make this work I had to set PACKAGESITE in /root/.cshrc and then login as root (or use su(1)) to be able to install the packgae from the appropriate site.
After I set PACKAGESITE in /root/.cshrc, I also tried to install another package using sudo pkg_add -r <pkgname> but it did not work. At this point, I started googling, reading man pages, etc. and I found out that sudo(8) was the problem, for some reason it was not using my environment variables, and in order to make it use them I had to do sudo -E.
Okay so here are my questions:
1. Is it okay if I do an alias in my .cshrc file (i.e. alias sudo sudo -E) so that I don't have to use sudo -E all the time?
2. Will forcing sudo(8) to use my environment variables create problems if I use it for anything else besides pkg_add(1)?
3. Is there a reason why sudo(8) is set by default to ignore the environment variables?
Thanks in advance!!
I was trying to install a package using sudo pkg_add -r <pkgname> and I noticed that pkg_add(1) was not using the PACKAGESITE variable that I had set in my .cshrc file. In order to make this work I had to set PACKAGESITE in /root/.cshrc and then login as root (or use su(1)) to be able to install the packgae from the appropriate site.
After I set PACKAGESITE in /root/.cshrc, I also tried to install another package using sudo pkg_add -r <pkgname> but it did not work. At this point, I started googling, reading man pages, etc. and I found out that sudo(8) was the problem, for some reason it was not using my environment variables, and in order to make it use them I had to do sudo -E.
Okay so here are my questions:
1. Is it okay if I do an alias in my .cshrc file (i.e. alias sudo sudo -E) so that I don't have to use sudo -E all the time?
2. Will forcing sudo(8) to use my environment variables create problems if I use it for anything else besides pkg_add(1)?
3. Is there a reason why sudo(8) is set by default to ignore the environment variables?
Thanks in advance!!