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
27f520a0
Commit
27f520a0
authored
Sep 13, 2002
by
Mike Hibler
Browse files
eventsys_control: make sure an experiment has nodes
eventsys_start: set both project and group GID, don't consider emulab-ops
parent
9ebf916a
Changes
2
Hide whitespace changes
Inline
Side-by-side
tbsetup/eventsys_control.in
View file @
27f520a0
...
...
@@ -216,6 +216,15 @@ if ($procid != 0) {
"
There is already an event scheduler running for
$pid
/
$eid
!
\n
");
}
#
# Do not start an event system for experiments with no nodes
#
if
(
!
ExpNodes
(
$pid
,
$eid
))
{
print
("
*** There are no nodes in
$pid
/
$eid
.
"
.
"
Not starting a scheduler.
\n
");
exit
(
0
);
}
#
# For now, lets not start an event system if there are no events.
#
...
...
tbsetup/eventsys_start.in
View file @
27f520a0
...
...
@@ -77,7 +77,15 @@ $query_result = DBQueryFatal("select pid,eid,expt_head_uid,gid ".
while
((
$pid
,
$eid
,
$uid
,
$gid
)
=
$query_result
->
fetchrow_array
())
{
my
$unix_uid
;
my
$group
;
my
$unix_gid
;
my
$unix_egid
;
my
$unix_pgid
;
#
# Ignore "special" experiments
#
if
(
$pid
eq
TB_OPSPID
)
{
next
;
}
#
# Figure out the unix uid/gid
...
...
@@ -87,16 +95,25 @@ while (($pid, $eid, $uid, $gid) = $query_result->fetchrow_array()) {
failed
("
no unix uid for DB uid
$uid
",
$pid
,
$eid
);
next
;
}
if
(
!
TBGroupUnixInfo
(
$pid
,
$gid
,
\
$unix_gid
,
\
$group
))
{
$unix_pgid
=
getgrnam
(
$pid
);
if
(
!
defined
(
$unix_pgid
))
{
failed
("
no unix gid for project
",
$pid
,
$eid
);
next
;
}
if
(
!
TBGroupUnixInfo
(
$pid
,
$gid
,
\
$unix_egid
,
\
$group
))
{
failed
("
no unix gid for DB gid
$gid
",
$pid
,
$eid
);
next
;
}
#
# Set real uid/gid to that of the user.
# Set uid/gid to that of the user. We need to be in both the
# project's unix group and the experiments's unix group in order
# for the scheduler to write its logfile (in eventsys_control).
#
# Set some environment too.
#
$EGID
=
$GID
=
$unix_gid
;
$GID
=
$unix_pgid
;
$EGID
=
"
$unix_pgid
$unix_pgid
$unix_egid
";
$EUID
=
$UID
=
$unix_uid
;
$ENV
{'
USER
'}
=
$uid
;
...
...
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