Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
0546251c
Commit
0546251c
authored
19 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Set uid as needed for running user's task epilog.
parent
e457184b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/slurmd/mgr.c
+7
-4
7 additions, 4 deletions
src/slurmd/mgr.c
src/slurmd/mgr.h
+4
-3
4 additions, 3 deletions
src/slurmd/mgr.h
with
11 additions
and
7 deletions
src/slurmd/mgr.c
+
7
−
4
View file @
0546251c
...
...
@@ -286,9 +286,10 @@ mgr_spawn_task(spawn_task_request_msg_t *msg, slurm_addr *cli,
/*
* Run a prolog or epilog script. Sets environment variables:
* SLURM_JOBID = jobid, SLURM_UID=uid, and
* MPIRUN_PARTITION=bgl_part_id (if not NULL)
* name IN: class of program (prolog, epilog, etc.)
* SLURM_JOBID = jobid, SLURM_UID=uid, and
* MPIRUN_PARTITION=bgl_part_id (if not NULL)
* name IN: class of program (prolog, epilog, etc.),
* if prefix is "user" then also set uid
* path IN: pathname of program to run
* jobid, uid, bgl_part_id IN: info on associated job for setting env vars
* max_wait IN: maximum time to wait in seconds, -1 for no limit
...
...
@@ -330,9 +331,11 @@ run_script(const char *name, const char *path, uint32_t jobid, uid_t uid,
if
(
bgl_part_id
)
setenvf
(
&
env
,
"MPIRUN_PARTITION"
,
"%s"
,
bgl_part_id
);
if
(
strncmp
(
name
,
"user"
,
4
)
==
0
)
setuid
(
uid
);
setpgrp
();
execve
(
path
,
argv
,
env
);
error
(
"
help!
%m"
);
error
(
"
execve():
%m"
);
exit
(
127
);
}
...
...
This diff is collapsed.
Click to expand it.
src/slurmd/mgr.h
+
4
−
3
View file @
0546251c
...
...
@@ -58,9 +58,10 @@ int mgr_launch_batch_job(batch_job_launch_msg_t *msg, slurm_addr *client);
/*
* Run a prolog or epilog script. Sets environment variables:
* SLURM_JOBID = jobid, SLURM_UID=uid, and
* MPIRUN_PARTITION=bgl_part_id (if not NULL)
* name IN: class of program (prolog, epilog, etc.)
* SLURM_JOBID = jobid, SLURM_UID=uid, and
* MPIRUN_PARTITION=bgl_part_id (if not NULL)
* name IN: class of program (prolog, epilog, etc.),
* if prefix is "user" then also set uid
* path IN: pathname of program to run
* jobid, uid, bgl_part_id IN: info on associated job for setting env vars
* max_wait IN: maximum time to wait in seconds, -1 for no limit
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment