[freeside] Exporting to shell machines and creation of home directories.

Ivan Kohler ivan at sisd.com
Mon Aug 9 17:11:53 PDT 1999


On Mon, Aug 09, 1999 at 05:24:15PM -0600, Ben Leibig wrote:
> Problem is that add user line in svc_acct.pm doesn't seem to actually be
> running.

If you look at the code, you'll see that there are several conditions that
need to be met:

  if ( $username 
       && $uid
       && $dir
       && $shellmachine
       && ! $nossh_hack ) {
    #one way
    ssh("root\@$shellmachine",
        "useradd -d $dir -m -s $shell -u $uid $username"
    );
    #another way
    #ssh("root\@$shellmachine","/bin/mkdir $dir; /bin/chmod 711 $dir; ".
    #  "/bin/cp -p /etc/skel/.* $dir 2>/dev/null; ".
    #  "/bin/cp -pR /etc/skel/Maildir $dir 2>/dev/null; ".
    #  "/bin/chown -R $uid $dir") unless $nossh_hack;
  }

Perhaps you need to create the `shellmachine' configuration file (see
htdocs/docs/config.html).

Perhaps you need to allow the freeside user on your freeside machine to
log in as root on the shell machine (see htdocs/docs/export.html#ssh).

Perhaps $username, $uid, or $dir is not set, or $nossh_hack is.  You could
verify this by putting a couple likes like:

  warn $username;

in there, before the `if' statement, and checking their output in the
error log.

>  I see nothing in the logs showing it is trying and nothing
> creating home directories.  I see a comment about using ssh_nohack to
> suppress it, but I can't find any other references to ssh_nohack.

I don't believe there is a $ssh_nohack variable.  Perhaps you mean
$FS::svc_acct::nossh_hack, referenced in htdocs/docs/man/svc_acct.txt
(1.2.1) or htdocs/docs/man/FS/svc_acct.html (CVS and future releases).

>  What
> program calls the insert routine?  Is it called when the account is first
> entered into the database or via bin/svc_export.

It is called when the account is first entered into the database
(htdocs/edit/process/svc_acct.cgi). 

> Additionally, I'm having a little spat with bill.  I have an invoice which
> shows a balance due of $22 dollars.  I've run bill -c 3 times now and the
> invoice(credit card) does not show up in cust_pay_batch.  Does it take a few
> days after the due date of the bill to be exported.

No, it should show up immediately.

Some conditions that would cause this not to happen (and the code that
does it, from sub FS::cust_main::collect):

  -Customer doesn't have an outstanding balance across all invoices

      my $total_owed = $self->balance;
      return '' unless $total_owed > 0; #redundant?????

  -Customer doesn't owe anything on this invoice
      next unless $cust_bill->owed > 0;

  -There is already a batched payment waiting for this invoice

      next if qsearchs( 'cust_pay_batch', { 'invnum' => $cust_bill->invnum } );

  -Customer doesn't have an outstanding balance across invoices previous
   to this one

      next unless $amount > 0;

>  Could the fact that
> invoice 21 was manually deleted be part of the problem.

Changing things in the database manually could certainly cause problems if
you weren't careful.  I don't have enough information to know if this is
causing your particular problem. 

> 	Thanks,
> 		Ben
> P.S. Ivan, you rock.  As soon as we make some money, you got a consulting
> job commin your way :)

*blush*  my thanks.

> 
> 
> > -----Original Message-----
> > From: Ivan Kohler [mailto:ivan at sisd.com]
> > Sent: Monday, August 09, 1999 5:11 PM
> > To: ivan-freeside at sisd.com
> > Subject: Re: [freeside] Exporting to shell machines and creation of home
> > directories.
> >
> >
> > On Mon, Aug 09, 1999 at 04:58:03PM -0600, Ben Leibig wrote:
> > > I asked this question before and was told that svc_acct.export
> > took care of
> > > exporting home directories.
> >
> > That is incorrect, and no message was posted to the list saying so (though
> > perhaps someone sent you incorrect information privately).
> >
> > >  Is there something special I have to do.  I
> > > can't seem to get freeside to create a home directory for a new
> > user on the
> > > shell machine.  I searched through the svc_acct.export code for anything
> > > that looked somehow related and came up empty handed.  Any ideas?
> >
> > You asked the same question previously, and Joel Griffiths kindly answered
> > in <http://www.sisd.com/freeside/list-archive/msg00807.html>.
> >
> > --
> > Ivan Kohler <ivan at sisd.com> - finger for PGP key -
> > <moc.dsis at navi> Relhok Navi
> > Open-source billing and administration for ISPs -
> http://www.sisd.com/freeside
> 20 4,16 * * * saytime # please don't be surprised if you find me dreaming
> too
> 

-- 
Ivan Kohler <ivan at sisd.com> - finger for PGP key - <moc.dsis at navi> Relhok Navi
Open-source billing and administration for ISPs - http://www.sisd.com/freeside
20 4,16 * * * saytime # please don't be surprised if you find me dreaming too



More information about the freeside-users mailing list