Skip to content

start_command for terminate_method assumes Bourne shell (or derivatives) #7

@catharsis

Description

@catharsis

Not sure if this is a lack of documentation or a bug, but here goes.

When terminate_method is set as an executable path, it is executed in start_command (https://github.com/gridengine/gridengine/blob/master/source/daemons/shepherd/builtin_starter.c#L1304) with the assumption that the shell should be a Bourne shell derivative by adding "-c" (which tells the shell to read commands from its operand as opposed to the default behaviour of reading them from stdin) to the arguments list to execvp (https://github.com/gridengine/gridengine/blob/master/source/daemons/shepherd/builtin_starter.c#L1419). This causes issues when the interpreting shell for the job has been changed with the -S parameter to qsub. In my case, I had it set to Python (2.7) in which -c specifies the command to execute.

To sum up, the argv array to execvp (in my case) basically ends up like:

char *args[4];
args[0] = "/path/to/terminate.py"
args[1] = "-c"
args[2] = "/path/to/terminate.py"
args[3] = NULL

and the Python interpreter says the following:
File "", line 1
/path/to/terminate.py
^
SyntaxError: invalid syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions