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
ce76dd93
Commit
ce76dd93
authored
Feb 04, 2005
by
Russ Fish
Browse files
Windows polishing.
parent
6f545cf0
Changes
6
Hide whitespace changes
Inline
Side-by-side
tmcd/cygwinxp/GNUmakefile.in
View file @
ce76dd93
...
...
@@ -63,6 +63,8 @@ bin-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/WSName.exe $(BINDIR)/WSName.exe
$(INSTALL) -m 755 $(SRCDIR)/addusers.exe $(BINDIR)/addusers.exe
$(INSTALL) -m 755 $(SRCDIR)/usrtogrp.exe $(BINDIR)/usrtogrp.exe
# Setx is run under CMD early in the user login to make HOME for Emacs.
$(INSTALL) -m 755 $(SRCDIR)/setx.exe $(SYSTEM32)/setx.exe
# These are used by tmcd/findif.
$(INSTALL) -m 755 $(SYSTEM32)/getmac.exe $(BINDIR)/getmac.exe
$(INSTALL) -m 755 $(WBEM)/framedyn.dll $(BINDIR)/framedyn.dll
...
...
tmcd/cygwinxp/liblocsetup.pm
View file @
ce76dd93
...
...
@@ -94,6 +94,17 @@ my $DEFSHELL = "/bin/tcsh";
my
$winusersfile
=
"
$BOOTDIR
/winusers
";
my
$usershellsfile
=
"
$BOOTDIR
/usershells
";
#
# system() with error checking.
#
sub
mysystem
($)
{
my
(
$cmd
)
=
@_
;
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed: (
$cmd
), $!
\n
");
}
}
#
# OS dependent part of cleanup node state.
#
...
...
@@ -111,26 +122,18 @@ sub os_account_cleanup()
print
"
Removing user:
$name
\n
";
# There is always an NT account.
my
$cmd
=
"
$NET
user
$name
/delete > /dev/null
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed: (
$cmd
), $!
\n
");
}
mysystem
("
$NET
user
$name
/delete > /dev/null
");
# There will only be an NT homedir if the user has logged in sometime.
$cmd
=
"
$RM
-rf C:/Documents and Settings/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed: (
$cmd
), $!
\n
");
}
mysystem
("
$CHOWN
-Rf root C:/'Documents and Settings'/
$name
");
mysystem
("
$RM
-rf C:/'Documents and Settings'/
$name
");
# It sometimes also makes user.PCnnn, user.PCnnn.000, etc.
mysystem
("
$CHOWN
-Rf root C:/'Documents and Settings'/
$name
.*
");
mysystem
("
$RM
-rf C:/'Documents and Settings'/
$name
.*
");
# Unmount the homedir so we can get to the mount point.
$cmd
=
"
$UMOUNT
/users/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed: (
$cmd
), $!
\n
");
}
$cmd
=
"
$RMDIR
/users/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed: (
$cmd
), $!
\n
");
}
mysystem
("
$UMOUNT
/users/
$name
");
mysystem
("
$RMDIR
/users/
$name
");
}
closedir
(
DIRHANDLE
);
...
...
@@ -145,19 +148,13 @@ sub os_account_cleanup()
next
;
}
$cmd
=
"
$CHOWN
-R root /sshkeys/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed (
$cmd
): $!
");
}
$cmd
=
"
$RM
-rf /sshkeys/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed (
$cmd
): $!
");
}
mysystem
("
$CHOWN
-Rf root /sshkeys/
$name
");
mysystem
("
$RM
-rf /sshkeys/
$name
");
}
closedir
(
DIRHANDLE
);
}
# Clean out the /proj directories.
# Clean out the /proj
sub
directories.
if
(
opendir
(
DIRHANDLE
,
"
/proj
"))
{
while
(
$name
=
readdir
(
DIRHANDLE
))
{
if
(
$name
=~
m/^\.+/
)
{
...
...
@@ -166,22 +163,13 @@ sub os_account_cleanup()
print
"
Removing project:
$name
\n
";
# Unmount the project dir so we can get to the mount point.
$cmd
=
"
$UMOUNT
/proj/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed (
$cmd
): $!
");
}
$cmd
=
"
$RMDIR
/proj/
$name
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed (
$cmd
): $!
");
}
mysystem
("
$UMOUNT
/proj/
$name
");
mysystem
("
$RMDIR
/proj/
$name
");
}
}
# Just unmount /share.
$cmd
=
"
$UMOUNT
/share
";
if
(
system
(
$cmd
)
!=
0
)
{
warning
("
Failed (
$cmd
): $!
");
}
# Just unmount /share, everybody gets one.
mysystem
("
$UMOUNT
/share
");
}
#
...
...
@@ -589,8 +577,7 @@ sub os_samba_mount($$$)
my
(
$local
,
$host
,
$verbose
)
=
@_
;
# Unmount each one first, ignore errors.
$cmd
=
"
$UMOUNT
$local
";
system
(
$cmd
);
system
("
$UMOUNT
$local
");
# Make the CygWin mount from the Samba path to the local mount point directory.
my
$sambapath
=
$local
;
...
...
tmcd/cygwinxp/prepare
View file @
ce76dd93
...
...
@@ -15,8 +15,9 @@ my @DBFILES = ();
my
@VARDIRS
=
("
logs
",
"
db
",
"
jails
",
"
boot
",
"
lock
",
"
lib/dhcp
");
my
$LOGDIR
=
"
/var/log
";
my
$RUNDIR
=
"
/var/run
";
my
$SOURCES
=
"
~root/flux/testbed
";
my
$HISTORY
=
"
~root/.bash_history
";
my
$SOURCES
=
"
/home/root/flux/testbed
";
my
$OBJS
=
"
/home/root/flux/obj-real
";
my
$HISTORY
=
"
/home/root/.bash_history
";
my
$MAILFILE
=
"
/var/spool/mail/root
";
my
$NTPDRIFT
=
"
/etc/ntp/drift
";
...
...
@@ -112,7 +113,7 @@ if (-f $NTPDRIFT) {
close(DRIFT);
}
print "Clearing out testbed sources ...\n";
print "Clearing out testbed sources
$SOURCES
...\n";
system
("
rm -rf
$SOURCES
");
print
"
Clearing out
$RUNDIR
...
\n
";
...
...
tmcd/cygwinxp/profile
View file @
ce76dd93
...
...
@@ -40,7 +40,7 @@ export USER
# 4) / (root)
### Try to get a connection to the Samba host.
/usr/local/etc/emulab/rc/rc.cygwinxp-user
##
/usr/local/etc/emulab/rc/rc.cygwinxp-user
### Use a local dir under sshd if the mount failed.
if [ ! -d "$HOME" ]; then
...
...
tmcd/cygwinxp/rc.cygwinxp
View file @
ce76dd93
...
...
@@ -6,6 +6,9 @@
#
# rc.cygwinxp - CygWin-specific startup. Run by rc.bootsetup on CygWin.
PATH
=
/usr/local/etc/emulab:/bin:
$SYSTEMROOT
/system32:
$PATH
export
PATH
# Enable logging.
logfile
=
/var/log/EmulabStartup.log
chmod
-f
g+w
$logfile
...
...
@@ -19,16 +22,43 @@ chmod g+w $iscygwin
chmod
-f
g-w /etc/emulab
# Make sure the computer name is right, reboots to change it if necessary.
nodeid
=
`
$
tmcc
nodeid
`
nodeid
=
`
tmcc nodeid
`
hostname
=
`
/bin/hostname
`
datehost
=
"
`
date
`
: Host name '
$hostname
'"
if
[
$nodeid
==
$hostname
]
;
then
echo
"
$datehost
matches nodeid '
$nodeid
'."
>>
$logfile
msg
=
"
$datehost
matches nodeid '
$nodeid
'."
echo
"
$msg
"
>>
$logfile
echo
"
$msg
"
else
echo
"
$datehost
differs from nodeid '
$nodeid
'."
>>
$logfile
msg
=
"
$datehost
differs from nodeid '
$nodeid
'."
>>
$logfile
echo
"
$msg
"
>>
$logfile
echo
"
$msg
"
# Change hostname and computername, rename My Computer, reboot on success.
/usr/local/etc/emulab/WSName /N:
$nodeid
/REBOOT /MCN
# Should never get here! Try /sbin/reboot.
datehost
=
"
`
date
`
: Host name '
$hostname
'"
newhost
=
`
/bin/hostname
`
msg
=
"
$datehost
didn't reboot changing to '
$newhost
'! Trying reboot."
echo
"
$msg
"
>>
$logfile
echo
"
$msg
"
/sbin/reboot
# Should never get here either!!! Try /bin/shutdown.
datehost
=
"
`
date
`
: Host name '
$hostname
'"
newhost
=
`
/bin/hostname
`
msg
=
"
$datehost
didn't /sbin/reboot changing to '
$newhost
'! Trying shutdown."
echo
"
$msg
"
>>
$logfile
echo
"
$msg
"
/bin/shutdown
-r
-f
now
# Give up.
datehost
=
"
`
date
`
: Host name '
$hostname
'"
newhost
=
`
/bin/hostname
`
msg
=
"
$datehost
failed to reboot changing to '
$newhost
'."
echo
"
$msg
"
>>
$logfile
echo
"
$msg
"
fi
# Sometimes the network stack gets out of sync: 'ipconfig /all' reports different
...
...
tmcd/cygwinxp/rc.cygwinxp-user
View file @
ce76dd93
...
...
@@ -11,7 +11,7 @@
#
# We also arrange for this to be run by login shells under ssh.
PATH
=
/usr/local/etc/emulab:/bin:
$PATH
PATH
=
/usr/local/etc/emulab:/bin:
$
SYSTEMROOT
/system32:
$
PATH
export
PATH
# Samba server.
...
...
Write
Preview
Markdown
is supported
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