summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a71e0dd)
Add a option %H to avoid jobid too long in some cases.
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: Iaf70da5de25fd321a21e6e6cd7f7d211dca1adf3
Reviewed-on: https://review.whamcloud.com/41262
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
* %e = executable
* %g = gid
* %h = hostname
* %e = executable
* %g = gid
* %h = hostname
* %j = jobid from environment
* %p = pid
* %u = uid
* %j = jobid from environment
* %p = pid
* %u = uid
char c;
while ((c = *jobfmt++) && joblen > 1) {
char c;
while ((c = *jobfmt++) && joblen > 1) {
int l;
if (isspace(c)) /* Don't allow embedded spaces */
int l;
if (isspace(c)) /* Don't allow embedded spaces */
*jobid = c;
joblen--;
jobid++;
*jobid = c;
joblen--;
jobid++;
l = snprintf(jobid, joblen, "%s",
init_utsname()->nodename);
break;
l = snprintf(jobid, joblen, "%s",
init_utsname()->nodename);
break;
+ case 'H': /* short hostname. Cut at first dot */
+ l = snprintf(jobid, joblen, "%s",
+ init_utsname()->nodename);
+ p = strnchr(jobid, joblen, '.');
+ if (p) {
+ *p = '\0';
+ l = p - jobid;
+ }
+ break;
case 'j': /* jobid stored in process environment */
l = jobid_get_from_cache(jobid, joblen);
if (l < 0)
case 'j': /* jobid stored in process environment */
l = jobid_get_from_cache(jobid, joblen);
if (l < 0)
verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
fi
verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
fi
+ if lctl set_param jobid_var=USER jobid_name="S.%j.%e.%u.%H.E"; then
+ JOBENV="JOBCOMPLEX"
+ JOBCOMPLEX="S.$USER.touch.$(id -u).$(hostname -s).E"
+
+ verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
+ fi
+
# test '%j' access to per-session jobid - if supported
if lctl list_param jobid_this_session > /dev/null 2>&1
then
# test '%j' access to per-session jobid - if supported
if lctl list_param jobid_this_session > /dev/null 2>&1
then