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