Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
111
Issues
111
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
846fa180
Commit
846fa180
authored
Oct 01, 2003
by
Leigh Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor exit status fixes.
parent
ea0b9b90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
tbsetup/batchexp.in
tbsetup/batchexp.in
+17
-1
tbsetup/startexp.in
tbsetup/startexp.in
+1
-1
www/beginexp.php3
www/beginexp.php3
+11
-1
No files found.
tbsetup/batchexp.in
View file @
846fa180
...
...
@@ -15,6 +15,15 @@ use Getopt::Std;
# supplied, an experiment shell is created (this is currently an admin
# only option).
#
# Exit codes are important; they tell the web page what has happened so
# it can say something useful to the user. Fatal errors are mostly done
# with die(), but expected errors use this routine. At some point we will
# use the DB to communicate the actual error.
#
# $status < 0 - Fatal error. Something went wrong we did not expect.
# $status = 0 - Everything okay.
# $status > 0 - Expected error. User not allowed for some reason.
#
sub
usage
()
{
die
("
Usage: batchexp [-i [-f]] [-x expires] [-E description] [-g gid]
"
.
...
...
@@ -45,6 +54,7 @@ my $tbdata = "tbdata";
my
$immediate
=
0
;
my
$frontend
=
0
;
my
$quiet
=
0
;
my
$errorstat
=-
1
;
my
$dbuid
;
my
@row
;
...
...
@@ -257,6 +267,8 @@ chmod(0664, "$nsfile");
# will display any errors.
#
if
(
system
("
$parser
-n
$pid
$gid
$eid
$nsfile
")
!=
0
)
{
# Obey exit status protocol for web page.
$errorstat
=
1
;
fatal
("
NS Parse failed!
");
}
...
...
@@ -296,6 +308,8 @@ if ($immediate) {
if
(
$quiet
);
if
(
system
("
$startexp
$optargs
-g
$gid
$pid
$eid
$nsfile
"))
{
# Obey exit status protocol for web page.
$errorstat
=
1
;
fatal
("
Failed to start experiment
$pid
/
$eid
!
");
}
}
...
...
@@ -306,6 +320,8 @@ else {
# at it.
#
if
(
system
("
$startexp
-f -b -g
$gid
$pid
$eid
$nsfile
"))
{
# Obey exit status protocol for web page.
$errorstat
=
1
;
fatal
("
Failed to preload batch experiment
$pid
/
$eid
!
");
}
# And drop the batch into the queue unless the user was preloading
...
...
@@ -348,7 +364,7 @@ sub fatal($)
#
TBExptDestroy
(
$pid
,
$eid
);
exit
(
-
1
);
exit
(
$errorstat
);
}
#
...
...
tbsetup/startexp.in
View file @
846fa180
...
...
@@ -427,7 +427,7 @@ sub fatal()
# case the user tries to muck with it.
#
if
(
$nodetach
)
{
exit
(
0
);
exit
(
$errorstat
);
}
#
...
...
www/beginexp.php3
View file @
846fa180
...
...
@@ -834,7 +834,7 @@ if ($delnsfile) {
# Fatal Error. Report to the user, even though there is not much he can
# do with the error. Also reports to tbops.
#
if
(
$retval
)
{
if
(
$retval
<
0
)
{
SUEXECERROR
(
SUEXEC_ACTION_DIE
);
#
# Never returns ...
...
...
@@ -842,6 +842,16 @@ if ($retval) {
die
(
""
);
}
# User error. Tell user and exit.
if
(
$retval
)
{
echo
"<br>"
;
echo
"<h3>Experiment could not be created</h3>"
;
echo
"<blockquote><pre>
$suexec_output
<pre></blockquote>"
;
PAGEFOOTER
();
exit
();
}
# add reasons to db, since we don't want to pass these on the command line.
if
(
$formfields
[
exp_noswap_reason
])
{
...
...
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