Commit 510921fb authored by Leigh B. Stoller's avatar Leigh B. Stoller

Remove mkacct from the makefile.

Change mkacct usage in mkproj to tbacct.
Change rmuser to invoke tbacct instead of issuing ssh commands to ops.
parent f4b99857
......@@ -26,7 +26,7 @@ USERBINS = os_load node_reboot nscheck node_update savelogs \
SBIN_STUFF = resetvlans console_setup.proxy sched_reload named_setup \
batch_daemon exports_setup reload_daemon sched_reserve \
console_reset db2ns bwconfig frisbeelauncher \
rmgroup mkgroup mkacct setgroups mkproj \
rmgroup mkgroup setgroups mkproj \
exports_setup.proxy vnode_setup eventsys_start \
sfskey_update sfskey_update.proxy rmuser
......@@ -36,7 +36,7 @@ LIBEXEC_STUFF = rmproj wanlinksolve wanlinkinfo \
assign_wrapper ptopgen webnodeupdate \
webdelay_config \
webrmgroup webswapexp webnodecontrol \
webmkgroup webmkacct websetgroups webmkproj \
webmkgroup websetgroups webmkproj \
spewlogfile staticroutes routecalc wanassign \
webidlecheck webnodereboot webrmuser
......@@ -94,8 +94,6 @@ post-install:
chmod u+s $(INSTALL_LIBEXECDIR)/rmproj
chown root $(INSTALL_SBINDIR)/rmgroup
chmod u+s $(INSTALL_SBINDIR)/rmgroup
chown root $(INSTALL_SBINDIR)/mkacct
chmod u+s $(INSTALL_SBINDIR)/mkacct
chown root $(INSTALL_SBINDIR)/mkgroup
chmod u+s $(INSTALL_SBINDIR)/mkgroup
chown root $(INSTALL_SBINDIR)/frisbeelauncher
......
......@@ -23,7 +23,7 @@ use English;
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $MKGROUP = "$TB/sbin/mkgroup";
my $MKACCT = "$TB/sbin/mkacct";
my $MKACCT = "$TB/sbin/tbacct add";
my $PROJROOT = "/proj";
my $GRPROOT = "/groups";
......
......@@ -25,9 +25,8 @@ my $CONTROL = "@USERNODE@";
my $BOSSNODE= "@BOSSNODE@";
my $HOMEDIR = "/users";
my $SSH = "$TB/bin/sshtb";
my $SETGROUPS = "$TB/sbin/setgroups";
my $USERDEL = "/usr/sbin/pw userdel";
my $DELACCT = "$TB/sbin/tbacct del";
my $dbuid;
my $user;
......@@ -239,33 +238,22 @@ DBQueryFatal("delete from userslastlogin where uid='$user'");
#
# Remove user from both local and control node.
#
# All this stuff must be done as root (ssh).
#
$UID = $EUID;
$EUID = $UID;
print "Removing user $user from local node.\n";
if (system("$USERDEL $user")) {
if (($? >> 8) != 67) {
fatal("Could not remove user $user from local node.");
}
}
system("$DELACCT $user") == 0 or
fatal("$DELACCT $user failed!");
if ($control_node ne $BOSSNODE) {
print "Removing user $user from $control_node.\n";
if (system("$SSH -host $control_node '$USERDEL $user'")) {
if (($? >> 8) != 67) {
fatal("Could not remove user $user from $control_node.");
}
}
}
$EUID = 0;
#
# Rename the users home dir if its there.
#
if (-d "$HOMEDIR/$user") {
my $newname = "HOMEDIR/$user-" . TBDateTimeFSSafe();
my $newname = "$HOMEDIR/$user-" . TBDateTimeFSSafe();
if (rename("$HOMEDIR/$user", $newname)) {
print "Renamed homedir to $newname. Remember to delete it!\n";
#
# Chown the owner/group to root and set the permissions so no
# one is allowed to look inside.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment