shellcommands queue - not getting the right information

Rick Eicher II rick at pbol.net
Tue Jun 18 16:10:55 PDT 2002


I am working on getting the shellcommands export of pre14 to create a shell
account. I have created a shellcommands export using the defaults that
appear
in the UI. I have user set as "root" and machine set as mail.pbol.net. I
have added the full path to the useradd commands etc. I can ssh to
root at mail.pbol.net with the user freeside on the freeside machine. I have
set a service up to use the export.

When I provision the service the export goes to the queue and never flushes
out. When I view the queue from the UI, I see that the args are
"8 /usr/sbin/useradd -d /home/carri...". I am not sure what purpose the "8"
serves. Every time I do it I always get an "8".

Looking into the code I see that the export is put into the queue and then
uses Net::SSH to run it. Reading from the man page on it, I see it uses a
user at machine , $command syntax. Again where did the "8" come from?

So I started apache in debug mode to watch what is going on. Here is a
small part of the action. This is in the shellcommands.pm file around line
23.

##########################################
DB<1> w
23:       my $command = $self->option($action);
24:       no strict 'refs';
25:       ${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields;
26===>     $self->shellcommands_queue( $svc_acct->svcnum,
27          $self->options('user')||'root'. "\@". $self->options('machine=
'),
28          eval(qq("$command"))
29        );
30      }
31
32      sub _export_replace {
  DB<1> p $self->options('user')
userrootuseradd/usr/sbin/useradd -d $dir -m -s $shell -u $uid
$usernameusermod/usr/sbin/usermod -d $new_dir -l $new_username -s $new_shell
-u $new_uid $old_usernameuserdel/usr/sbin/userdel $username
  DB<2> p $self->options('machine')
userrootuseradd/usr/sbin/useradd -d $dir -m -s $shell -u $uid=20
$usernameusermod/usr/sbin/usermod -d $new_dir -l $new_username -s $new_shell
-u $new_uid $old_usernameuserdel/usr/sbin/userdel $username
  DB<3> p $command
/usr/sbin/useradd -d $dir -m -s $shell -u $uid $username
############################################

I wanted to check and see what was being passed to shellcommands_queue. The
$command is what would be expected. But the $self->options('user') and
$self->options('machine') are equal and not what would be expected or need
to make a Net::SSH statement work.

Thank you for your time,
Richard Eicher II
www.pbol.net







More information about the freeside-users mailing list