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
7379d2bb
Commit
7379d2bb
authored
Nov 05, 2004
by
Russ Fish
Browse files
Small details.
parent
38e762f1
Changes
7
Hide whitespace changes
Inline
Side-by-side
tmcd/cygwinxp/GNUmakefile.in
View file @
7379d2bb
...
...
@@ -70,6 +70,8 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
$(INSTALL) -m 755 $(SRCDIR)/emount $(BINDIR)/emount
$(INSTALL) -m 755 $(SRCDIR)/eumount $(BINDIR)/eumount
$(INSTALL) -m 755 $(SRCDIR)/startsshd $(BINDIR)/startsshd
$(INSTALL) -m 755 $(SRCDIR)/stopsshd $(BINDIR)/stopsshd
sfs-install:
...
...
tmcd/cygwinxp/emount
View file @
7379d2bb
#!/usr/bin/perl -w
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
...
...
@@ -12,7 +11,13 @@ use Getopt::Std;
# Emulab NFS mount command, called by rc.mounts .
#
# Args are the remote and local mount points, for example:
# eumount fs.emulab.net:/q/proj/testbed /proj/testbed
# emount fs.emulab.net:/q/proj/testbed /proj/testbed
#
# One arg is just the username, with the rest defaulted in for convenience.
# emount russ
# is equivalent to:
# emount fs.emulab.net:/users/russ /users/russ
#
# With no args, reports the current mounts with "net use".
#
# Since this is Windows, mounts go through drive letters, like this:
...
...
@@ -32,6 +37,7 @@ use Getopt::Std;
sub
usage
()
{
print
"
Usage: emount [-v] [-d driveletter:] remotehost:path localpath
\n
";
print
"
or: emount [-v] [-d driveletter:] username
\n
";
print
"
or: emount
\n
";
exit
(
1
);
}
...
...
@@ -40,6 +46,7 @@ my $verbose = 0;
my
$driveletter
=
"";
my
$remote
=
"";
my
$local
=
"";
my
$username
=
"";
# Drag in path stuff so we can find emulab stuff.
BEGIN
{
require
"
/etc/emulab/paths.pm
";
import
emulabpaths
;
}
...
...
@@ -74,6 +81,11 @@ if (@ARGV == 0 ) {
system
("
$NET
use
");
exit
(
0
);
}
elsif
(
@ARGV
==
1
)
{
$username
=
$ARGV
[
0
];
$local
=
"
/users/
$username
";
$remote
=
"
fs.emulab.net:
$local
";
}
elsif
(
@ARGV
==
2
)
{
$remote
=
$ARGV
[
0
];
$local
=
$ARGV
[
1
];
...
...
tmcd/cygwinxp/eumount
View file @
7379d2bb
#!/usr/bin/perl -w
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
...
...
@@ -11,15 +10,18 @@ use Getopt::Std;
#
# Emulab NFS unmount command, called by rc.mounts . See emount for more info.
#
# Arg is the local mount points, for example:
# eumount /proj/testbed
# Arg is the local mount point or user name, for example:
# eumount /users/russ
# or:
# eumount russ
#
# The Services For Unix (SFU 3.5) NFS client commands are used underneath, and the
# CygWin symlink pointing to the /cygdrive/driveletter mount are cleaned up.
sub
usage
()
{
print
"
Usage: eumount [-v] localpath
\n
";
print
"
Usage: eumount [-v] /local/path
\n
";
print
"
or: eumount [-v] username
\n
";
exit
(
1
);
}
my
$optlist
=
"
v
";
...
...
@@ -54,6 +56,9 @@ if (defined($options{"v"})) {
}
if
(
@ARGV
==
1
)
{
$local
=
$ARGV
[
0
];
if
(
$local
!~
m|/|
)
{
$local
=
"
/users/
$local
";
}
}
else
{
usage
();
...
...
tmcd/cygwinxp/rc.cygwinxp
View file @
7379d2bb
...
...
@@ -4,15 +4,18 @@
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# CygWin startup.
# CygWin startup.
Run as a service named EmulabStartup.
# Make sure the node name is right.
nodeid
=
`
/usr/local/etc/emulab/tmcc.bin nodeid
`
hostname
=
`
/bin/hostname
`
# Do some logging.
logfile
=
/var/log/EmulabStartup.log
datehost
=
"
`
date
`
: Host name '
$hostname
'"
if
[
$nodeid
==
$hostname
]
;
then
echo
"
Host name '
$hostname
'
matches nodeid '
$nodeid
'."
>
/tmp/wsnam
e
echo
"
$datehost
matches nodeid '
$nodeid
'."
>
>
$logfil
e
else
echo
"
Host name '
$hostname
' and nodeid '
$nodeid
' differ."
>
/tmp/wsnam
e
echo
"
$datehost
differs from nodeid '
$nodeid
'."
>>
$logfil
e
# Change hostname and computername, rename My Computer, reboot on success.
/usr/local/etc/emulab/WSName /N:
$nodeid
/REBOOT /MCN
...
...
tmcd/cygwinxp/rc.cygwinxp-user
View file @
7379d2bb
...
...
@@ -4,26 +4,34 @@
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# CygWin user setup for each login.
# CygWin user setup for each rdesktop login. This gets run from a Registry key:
# HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\EmulabLogin
# with value:
# C:\cygwin\bin\bash /usr/local/etc/emulab/rc/rc.cygwinxp-user
PATH
=
/usr/local/etc/emulab:
$PATH
set
-x
# Mounts are local to the Win32 login session context.
if
[
-e
/cygdrive/s
]
;
then
/cygdrive/c/SFU/common/umount S:
>
/dev/null
;
fi
echo
emount fs.emulab.net:/share /share
emount fs.emulab.net:/share /share
if
[
-e
/cygdrive/p
]
;
then
/cygdrive/c/SFU/common/umount P:
>
/dev/null
;
fi
proj
=
`
tmcc.bin status |
sed
's|ALLOCATED=\([^/]*\)/.*|\1|'
`
echo
emount fs.emulab.net:/q/proj/
$proj
/proj/
$proj
emount fs.emulab.net:/q/proj/
$proj
/proj/
$proj
# Where do we find out the group information for an optional Q: mount?
if
[
-e
/cygdrive/h
]
;
then
/cygdrive/c/SFU/common/umount H:
>
/dev/null
;
fi
creator
=
`
tmcc.bin creator |
sed
's|.*CREATOR=\([^ ]*\).*|\1|'
`
echo
emount fs.emulab.net:/users/
$creator
/users/
$creator
emount fs.emulab.net:/users/
$creator
/users/
$creator
if
[
-e
/cygdrive/i
]
;
then
/cygdrive/c/SFU/common/umount I:
>
/dev/null
;
fi
swapper
=
`
tmcc.bin creator |
sed
's|.*SWAPPER=\([^ ]*\).*|\1|'
`
if
[
$swapper
!=
$creator
]
;
then
echo
emount fs.emulab.net:/users/
$swapper
/users/
$swapper
emount fs.emulab.net:/users/
$swapper
/users/
$swapper
fi
...
...
@@ -31,10 +39,16 @@ fi
if
[
-e
/cygdrive/j
]
;
then
/cygdrive/c/SFU/common/umount J:
>
/dev/null
;
fi
user
=
`
id
-un
`
if
[[
$user
!=
$creator
&&
$user
!=
$swapper
&&
$user
!=
root
]]
;
then
echo
emount
-d
J: fs.emulab.net:/users/
$user
/users/
$user
emount
-d
J: fs.emulab.net:/users/
$user
/users/
$user
fi
set
+x
echo
"Hit <Enter> to dismiss."
sed
1q
# Run the SSH daemon in the Win32 login session context, so ssh client sessions
# will see the same set of mounts when they come in AS THIS SAME USER.
echo
""
startsshd
echo
""
echo
"Hit <Enter> to dismiss this window."
read
tmcd/cygwinxp/startsshd
0 → 100755
View file @
7379d2bb
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# Run the SSH daemon in the Win32 login session context, so ssh client sessions
# will see the same set of mounts when they come in AS THIS SAME USER.
#
# Other users need to come is as rdesktop first if they want ssh sessions with
# their remote homedirs mounted. Doing this disconnects the first rdesktop session
# after 20 seconds, but reconnecting as the original user gets it right back.
# Microsoft cripples Citrix/Hydra on XP to only allow one rdesktop session at a time.
#
# Do "ssh pcNNN qwinsta" (Query WINdows STAtion) to show the sessions remotely.
# Use "ssh pcNNN rwinsta ID" to kill a session by session ID.
# If you're logged in via rdesktop, see the Users tab in Task Manager.
pidfile
=
/var/run/sshd.pid
running
=
if
[
-e
$pidfile
]
;
then
# Check that the process ID actually refers to a running process.
pid
=
`
cat
$pidfile
`
if
(
kill
-0
$pid
>
& /dev/null
)
;
then
running
=
yes
fi
fi
if
[
$running
]
;
then
# Kill a previous copy of sshd, so we can run one as this user.
echo
"Killing previous sshd daemon."
ps
-ef
|
awk
'$2=='
$pid
'{print}'
kill
$pid
fi
# Hijack the file permissions needed for sshd to run as this user.
user
=
`
id
-un
`
chown
$user
/etc/ssh
*
key
chmod
o-r /etc/ssh
*
key
chown
$user
/var/empty
chmod
go-w /var/empty
# Start sshd in the background, orphaned so it doesn't get SIGINT from here.
# The pidfile is updated by sshd itself.
echo
"Starting new sshd daemon as
$user
."
(
CYGWIN
=
"ntsec tty"
/usr/sbin/sshd &
)
tmcd/cygwinxp/stopsshd
0 → 100755
View file @
7379d2bb
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
# Stop the current the SSH daemon.
pidfile
=
/var/run/sshd.pid
running
=
if
[
-e
$pidfile
]
;
then
# Check that the process ID actually refers to a running process.
pid
=
`
cat
$pidfile
`
if
(
kill
-0
$pid
>
& /dev/null
)
;
then
running
=
yes
fi
fi
if
[
$running
]
;
then
echo
"Killing sshd daemon."
ps
-ef
|
awk
'$2=='
$pid
'{print}'
kill
$pid
fi
# Restore the file permissions needed for sshd to run as a service.
user
=
`
id
-un
`
chown
SYSTEM /etc/ssh
*
key
chmod
o-r /etc/ssh
*
key
chown
SYSTEM /var/empty
chmod
go-w /var/empty
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