Forum Moderators: bakedjake

Message Too Old, No Replies

Cron group/user/permissions question

Cron group/user/permissions question

         

ProFiler

2:29 pm on Dec 19, 2003 (gmt 0)

10+ Year Member



Hey,

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!

bakedjake

3:52 pm on Dec 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld, ProFiler!

Can you ls -la the /etc/mail/virtusertable and output the results here?

Thanks.

ProFiler

4:04 pm on Dec 19, 2003 (gmt 0)

10+ Year Member



www# lla /etc/mail/virtusertable
-rw------- 1 root wheel 26898 Dec 19 07:26 /etc/mail/virtusertable

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