On Wed, 29 Aug 2001 at 10:49am, Rebecca Pakish wrote
> $su amanda -c "touch tapetype"
> which did create a tapetype file in my /usr/local/etc/amanda/backup dir.
> Then I was able to run my
> $su amanda -c "amlabel backup testtape01"
> bash: /root/.bashrc: Permission denied
> rewinding, reading label testtape01
> rewinding, writing label testtape01, checking label, done.
>
> I now have a tapelist file in my /usr/local/etc/amanda/backup file...so it
> appears to have worked...but how do I get rid of this bash permission denied
> message???
OK, I think I see what's going on. You're running that su as root, right?
Well, it's not giving amanda (the user) its own environment, i.e. $HOME
is still set to /root (root's home). So, the user amanda, in starting
its shell to run the command, tries to parse $HOME/.bashrc, and can't,
because it doesn't have permission. Try this:
su - amanda -c "amlabel backup testtape01"
This will give amanda its environment.
--
Joshua Baker-LePain
Department of Biomedical Engineering
Duke University