Skip to content

mxqi: workdir option #395

Closed
arndt opened this issue Jul 15, 2024 · 6 comments · Fixed by #397
Closed

mxqi: workdir option #395

arndt opened this issue Jul 15, 2024 · 6 comments · Fixed by #397

Comments

@arndt
Copy link

arndt commented Jul 15, 2024

As for mxqsub the working dir should the current working dir. In addition an option -w should be provided.

> mxqsub -h
mxqsub - MXQ v0.31.4 (beta)
[...]
  -w, --workdir=DIRECTORY   set working directory (has to exist)
                                                       (default: current workdir)
@donald
Copy link
Collaborator

donald commented Jul 15, 2024

Hmm. That would be complex to implement. mxqi is abusing ssh and sshd places the process into the user home directory before invoking the login shell. So at a minimum we'd need to use a customized sshd version.

When defaulting the directory to be something else than $HOME, problems could be expected. For example, users might put commands into their .bashrc which just assume to be in $HOME.

What is the use case? Its an interactive shell, so you are expected to type something anyway. Why is mxqi -w /some/where and then typing commands into the session more complex that typing cd /some/where as the first command?

@arndt
Copy link
Author

arndt commented Jul 15, 2024

I guess this depends on the workflow - I usually go through the filesystem to a specific place - then see whether I am at the right place (using less and other simple commands) and then decide that I need to work here in this dir. Only now would I start mxqi to get a relevant resources.

In this case I would need to start to cd all over again.

I see the problem with sshd - but could you alternatively put a MXQ_SUBMIT_WD into the env? Then one could just cd $MXQ_SUBMIT_WD and is where one left.

@donald donald mentioned this issue Jul 15, 2024
@donald
Copy link
Collaborator

donald commented Jul 15, 2024

While looking into your request, we found another bug :-)

Worked in my tests. Does this look usable for you?

@arndt
Copy link
Author

arndt commented Jul 15, 2024

This looks good - particular like the:

test -n "$MXQI_SUBMIT_WD" && cd "$MXQI_SUBMIT_WD"

Can I use it already? Don't see the MXQI_SUBMIT_WD in my env yet.

@donald
Copy link
Collaborator

donald commented Jul 15, 2024

Now you can :-)

@arndt
Copy link
Author

arndt commented Jul 16, 2024

Works like a charm - thanks a lot!

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants