On Sun, Jul 01, 2001 at 01:54:23PM -0500, [EMAIL PROTECTED] wrote:
> the script builds a new /etc/aliases that is composed all all the customer
> pieces. this happens properly, however, when i attempt to restart sendmail
> and run newaliases from within the same script, the newaliases output
> shows 0 aliases created. if i take the same commands and insert them into
> another perl script that is run directly after the first script which
> builds the new /etc/aliases, everything seems fine

This sounds very much like a buffering problem.  I note a few confusing
places in your code below; it would appear you're not closing filehandles,
and thus flushing them, before playing with them.



[snip irrelevant code]
> #write contents of include files into the tmp virtusertable
> open VWF, ">>$vtmp" or die "Cant open virtuser temp file $!\n";
> for $each(@vcontents) {
>   next if ( $each eq "." );
>   next if ( $each eq ".." );
>   open FH, $each or die "Cant open virtuser include file $!\n";
>   print VWF "\#\#\# $each \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
>   print VWF <FH>;
>   close FH;
> }
> close WF;

You must mean close VWF, not WF; I don't see WF ever opened.


 
> #change into the aliases include directory
> chdir "$inc/aliases" or die "Cant change to aliases include directory
> $!\n";
> 
> #write contents of include files into the tmp aliases
> open AWF, ">>$atmp" or die "Cant open aliases temp file $!\n";
> for $each(@acontents) {
>   next if ( $each eq "." );
>   next if ( $each eq ".." );
>   open FH, $each or die "Cant open aliases include file $!\n";
>   print AWF "\#\#\# $each \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
>   print AWF <FH>;
>   close FH;
> }
> close WF;

Again, close AWF, not WF.

 
Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to