Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
b87ed3e4
Commit
b87ed3e4
authored
Dec 04, 2000
by
Kristin Wright
Browse files
Removed tarring & rmdir (will go into rmacct-ctrl). changed
rmuser call to 'pw userdel'. added call to killtip.
parent
89bf2035
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/rmacct
View file @
b87ed3e4
#!/usr/local/bin/perl -wT
###
### $Id: rmacct,v 1.
6
2000-1
1-29 21:35:33
kwright Exp $
### $Id: rmacct,v 1.
7
2000-1
2-04 19:53:08
kwright Exp $
###
### rmacct - Removes accounts for all users in given experiment.
###
...
...
@@ -139,17 +139,19 @@ print "\n";
##
## Save user dirs in tar file unless -nt specified
## Commented out because we will move this to rmacct-ctrl. -lkw 11/30/00
##
if
(
$savedir
)
{
foreach
my
$user
(
@users
)
{
if
(
-
e
"
/users/
$user
"
)
{
print
"
Creating
$user
.tar in /tmp
\n
";
open
(
TAR
,
"
/usr/bin/tar cvf /tmp/
$user
.tar /users/
$user
2>&1 |
");
while
(
<
TAR
>
)
{
print
"
$_
";
}
close
(
TAR
);
}
}
}
#if ( $savedir ) {
# foreach my $user (@users) {
# if ( -e "/users/$user" ) {
# print "Creating $user.tar in /tmp\n";
# open(TAR, "/usr/bin/tar cvf /tmp/$user.tar /users/$user 2>&1 |");
# while (<TAR>) { print "$_"; }
# close(TAR);
# }
# }
#}
##
## For each machine, ping to see if its alive.
...
...
@@ -191,8 +193,9 @@ foreach $IP (@nodes) {
## FreeBSD says "155.99.214.129: Connection refused"
## and can also say "Host key doesn't match..."
## and can also say "@@@@@@... WARNING HOST ID CHANGED..."
## and can also say "Cannot stat authentication socket dir..."
if
(
(
$_
=~
/^Sorry/
)
||
(
$_
=~
/^$IP/
)
||
(
$_
=~
/^Host key/
)
||
(
$_
=~
/^@+/
)
)
{
||
(
$_
=~
/^@+/
)
||
(
$_
=~
/^Cannot stat/
)
)
{
die
("
Uname failed on
$IP
:
$_
\n
");
}
else
{
$OS
=
$_
;
...
...
@@ -223,11 +226,16 @@ foreach $IP (@nodes) {
## Fetch remote login information
foreach
my
$user
(
@users
)
{
#
# Note: rmuser removes the user dir. Change to a call
# to pw userdel instead. User dir should get removed only
# when project ends, not when an experiment ends (which is
# when rmacct gets called).
#
print
"
Removing
$user
from
$IP
\n
";
open
(
RMUSER
,
"
/usr/local/bin/sshtb
$IP
/usr/sbin/
rm
user
-y
$user
2>&1 |
");
while
(
<
RMUSER
>
)
{
print
"
$_
";
}
close
(
RMUSER
);
open
(
PWDEL
,
"
/usr/local/bin/sshtb
$IP
/usr/sbin/
pw
user
del
$user
2>&1 |
");
while
(
<
PWDEL
>
)
{
print
"
$_
";
}
close
(
PWDEL
);
}
print
"
Removing group
$group
from
$IP
\n
";
...
...
@@ -270,10 +278,10 @@ foreach $user (@users) {
print
"
$user
$node_id
\n
";
if
(
$user
=~
/^(([a-z]|\d)+)$/
)
{
$u
=
$
1
;
if
(
$node_id
=~
/^tb(pc|sh)([0-9])+$/
)
{
if
(
$node_id
=~
/^
(
tb(pc|sh)([0-9])+$
)
/
)
{
$n
=
$
1
;
print
"
\t
killtip
$u
ser
$node_id
\n
";
open
(
KILLTIP
,
"
/usr/testbed/bin/killtip
$u
$n
2>&1 |
");
print
"
\t
killtip
$u
$n
\n
";
open
(
KILLTIP
,
"
/usr/local/bin/sshtb plastic
/usr/testbed/bin/killtip
$u
$n
2>&1 |
");
while
(
<
KILLTIP
>
)
{
print
"
$_
";
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment