jupyterhub / jupyterhub/systemdspawner
Option for separate WorkingDirectory and initial Jupyter directory?
- Dominant language
- Python
- Stars
- 100
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
First of all: many thanks for creating this tool! It's super awesome.
We use jupyterhub on an academic computer cluster where the home directories are exported from another machine via NFS. With root squashing, this means that root can't see or cd into users' home directories. As such, when systemd-run is run and by default sets the WorkingDir to the spawning user's home directory, this fails and the service fails with the 200/CHDIR error.
I guess this relates to the order in which systemd does the chdir to the WorkingDir and becoming the User? Once it has become the specified user it *can* chdir into the home directory, but as root it can't!
(In our case, jupyterhub runs as a special "jupyterhub" user who has sudo power to run systemd-run, but I don't *think* this matters.)
I can override this with the "user_workingdir" setting -- nice! -- but actually I would like it if jupyterhub session started in the user's home directory.
From what I can see, you are not explicitly setting the WorkingDir in the systemd-run call, so I guess I am proposing adding a config option that would allow setting this -- its default of the user's home dir doesn't work in this case. It looks like later systemd-run commands support a --working-dir option, but my old systemd 229 does not -- maybe a --property=WorkingDir=XXX works?
I can probably figure out how to do this and send a PR if you think this is reasonable.
Thanks again!
Contributor guide
Assessment
This issue has not been assessed yet.