From 63782986e28d1ed122d6a9fd4073f2f677b13e59 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 26 Sep 2014 18:57:44 -0700 Subject: [PATCH 1/2] flux-start: fix srun job name option srun(1) option to set job name is --job-name not --jobname. --- src/cmd/flux-start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/flux-start.c b/src/cmd/flux-start.c index 43236a72140f..151a8fc03e29 100644 --- a/src/cmd/flux-start.c +++ b/src/cmd/flux-start.c @@ -300,7 +300,7 @@ void start_slurm (int size, int kary, const char *modules, const char *modopts, argv_push (&ac, &av, "--propagate=CORE"); if (!cmd) argv_push (&ac, &av, "--pty"); - argv_push (&ac, &av, "--jobname=%s", "flux"); + argv_push (&ac, &av, "--job-name=%s", "flux"); if (partition) argv_push (&ac, &av, "--partition=%s", partition); From c3c507f313250613a6ccf482f14fe162f1a1b3f0 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 26 Sep 2014 19:03:19 -0700 Subject: [PATCH 2/2] flux-start: use POSIXLY_CORRECT when processing args with getopt We don't want to parse flux-start `command` args as our own, so be sure to set the POSIXLY_CORRECT flag for getopt_long() so that it stops processing at the first non-option arg. That way commands with arguments are processed unharmed. (This is done by prepending '+' to shortopts in getopt_long(3). For example, before this commit, flux-start eradicates all options to wreckrun in this test: flux start -N4 flux wreckrun -N4 hostname after the commit, wreckrun args should be preserved. --- src/cmd/flux-start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/flux-start.c b/src/cmd/flux-start.c index 151a8fc03e29..fe5b71e304be 100644 --- a/src/cmd/flux-start.c +++ b/src/cmd/flux-start.c @@ -47,7 +47,7 @@ void start_slurm (int size, int kary, const char *modules, const char *modopts, */ const int child_wait_seconds = 1; -#define OPTIONS "hvs:k:M:O:XN:p:S" +#define OPTIONS "+hvs:k:M:O:XN:p:S" static const struct option longopts[] = { {"help", no_argument, 0, 'h'}, {"verbose", no_argument, 0, 'v'},