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
febd8fa3
Commit
febd8fa3
authored
Sep 26, 2012
by
Gary Wong
Browse files
Arrange for the TCP proxy to start and die with the testbed.
parent
dd445ae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
rc.d/3.testbed.sh.in
View file @
febd8fa3
...
...
@@ -117,6 +117,11 @@ case "$1" in
@prefix@/sbin/portal_daemon
fi
if
[
-x
@prefix@/sbin/tcppd
]
;
then
echo
-n
" tcppd"
@prefix@/sbin/tcppd &
fi
#
# Could trigger experiment creation, so make sure everything
# else is setup first; i.e., run this last!
...
...
@@ -190,6 +195,9 @@ case "$1" in
if
[
-r
/var/run/portal_daemon.pid
]
;
then
kill
`
cat
/var/run/portal_daemon.pid
`
fi
if
[
-r
/var/run/tcppd.pid
]
;
then
kill
`
cat
/var/run/tcppd.pid
`
fi
;;
*
)
...
...
utils/tcppd.in
View file @
febd8fa3
...
...
@@ -66,6 +66,14 @@ my $ctrl = new IO::Socket::INET( LocalAddr => '127.0.0.1',
Blocking
=>
0
)
or
die
"
socket: $!
\n
";
# Write our PID to a known location (to assist those who would kill us).
# Don't bother attempting to use the PID file as a lock -- the socket
# we just listened on makes a better mutex than a file would.
sysopen
(
PIDFILE
,
"
/var/run/tcppd.pid
",
O_WRONLY
|
O_CREAT
)
||
fatal
("
Couldn't create '
$pidfile
': $? $!
\n
");
print
PIDFILE
"
$$
";
close
PIDFILE
;
my
$readlist
=
IO::
Select
->
new
(
$ctrl
)
or
die
"
select: $!
\n
";
...
...
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