-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helper: Rename create_job_tmpdir to tmpdir-setup
Rename helper/create_job_tmpdir to helper/tmpdir-setup. Leave the obsolete helper script around to support a rolling upgrade.
- Loading branch information
Showing
3 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/bash | ||
|
||
# Input (environment): | ||
# | ||
# MXQ_JOBID : job ident | ||
# MXQ_SIZE : size in GB | ||
# MXQ_UID : uid | ||
|
||
# Output: | ||
# | ||
# /dev/shm/mxqd/tmp/$JOBID mounted, space from /scratch/local2 | ||
|
||
tmpdir=/scratch/local2/mxqd/tmp | ||
mntdir=/dev/shm/mxqd/mnt/job | ||
filename=$tmpdir/$MXQ_JOBID.tmp | ||
mountpoint=$mntdir/$MXQ_JOBID | ||
|
||
umask 006 | ||
mkdir -p $tmpdir | ||
mkdir -p $mntdir | ||
|
||
status=1; | ||
|
||
if fallocate -l ${MXQ_SIZE}G $filename; then | ||
if loopdevice=$(losetup --find --show $filename); then | ||
if mkfs.ext4 \ | ||
-q \ | ||
-m 0 \ | ||
-E nodiscard,mmp_update_interval=300,lazy_journal_init=1,root_owner=$MXQ_UID:0 \ | ||
-O '64bit,ext_attr,filetype,^has_journal,huge_file,inline_data,^mmp,^quota,sparse_super2' \ | ||
$loopdevice \ | ||
&& mkdir -p $mountpoint && mount -Odata=writeback,barrier=0 $loopdevice $mountpoint; then | ||
rmdir $mountpoint/lost+found | ||
status=0 | ||
fi | ||
losetup -d $loopdevice | ||
fi | ||
rm $filename | ||
else | ||
test -e $filename && rm $filename | ||
fi | ||
exit $status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters