Forum Moderators: bakedjake
I have a script that reads all lines in a bunch of files and dumbs them into
/etc/mail/virtusertable
and then runs the command
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
---
This shell script runs fine when ran from shell (/home/mailalias_walker.sh)
However, I cronned the script and after figuring out what shell runs at so I could give it the right permissions to write to /etc/mail/virtusertable I ran into the next and last problem getting this to work:
makemap: error opening type hash map /etc/mail/virtusertable: Permission denied
I even tried setting the /etc/mail/virtusertable to 777 but that didnīt relate to this issue.
The fact is that the part of the script that dumps all the lines in /etc/mail/virtusertable DOES work fine, but when I then ran the
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
(I also tried:
/usr/sbin/makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable)
It makes the file 0 bytes again. I donīt know whatīs wrong cuz setting /etc/mail/virtusertable to 777 should have done the trick, eventhough I wouldnīt have used that as a permanent solution for security.
Anyway when cron fuxors up / fails, it informs me per email, so itīs been sending:
makemap: error opening type hash map /etc/mail/virtusertable: Permission denied
Now I know my way around Unix but Iīm not sure what to do with the above error. I mean like I said that file is 777 and Iīm not sure why itīs giving me permission denied stuff. Do I maybe need to alter the chmod of /etc/mail directory? (currently set to 755)
Sorry if this is a bit confusing :D Any help is greatly appreciated!
But as said I also tested while it had 777 / -rwxrwxrwx
The root user and wheel group were like they had always been so thatīs why I didnīt touch that!
Thanks for any help! And btw lla is an alias I made for ls -al