summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--job.common17
1 files changed, 13 insertions, 4 deletions
diff --git a/job.common b/job.common
index 165f61c..a27ce12 100644
--- a/job.common
+++ b/job.common
@@ -1,5 +1,11 @@
# vim: ft=sh
set -e
+# Ensure niceness at least 10
+if [ "$(nice)" -lt 10 ]; then
+ exec nice "$0" "$@"
+fi
+
+# Use fake laminar in case of external execution
if [ -z "$WORKSPACE" ]; then
. "$(dirname "$(readlink -f "$0")")/../fakelaminar"
fi
@@ -9,17 +15,20 @@ if [ -z "$LAMINAR_COMMON" ]; then
export LAMINAR_COMMON=y
# Job and template id
- export JOBID="$(basename "$0" | sed 's/\.run$//')"
- export TEMPLATEID="$(basename "$(readlink -f "$0")" | sed 's/\.run$//')"
+ JOBID="$(basename "$0" | sed 's/\.run$//')"
+ TEMPLATEID="$(basename "$(readlink -f "$0")" | sed 's/\.run$//')"
+ export JOBID TEMPLATEID
# Template workspace
- export TWORKSPACE="$HOME/workspace/$TEMPLATEID"
+ TWORKSPACE="$HOME/workspace/$TEMPLATEID"
if [ "$JOBID" = "$TEMPLATEID" ]; then
TWORKSPACE="$HOME/workspace/notemplate"
fi
+ export TWORKSPACE
# Files directory
- export FILES="$(readlink -f "$(dirname "$(readlink -f "$0")")/../files")"
+ FILES="$(readlink -f "$(dirname "$(readlink -f "$0")")/../files")"
+ export FILES
fi