JupyterLab Notebook: Byobu unusable due to ownership conflict
Closed this issue · 4 comments
Describe the bug
Byobu cannot be used on notebooks due to permissions isolation:
Environment info
Namespace: Any
Notebook/server: Any
Steps to reproduce
Steps to reproduce the behavior:
- Launch a JLab notebook
- type
byobu
- see error
Expected behaviour
Byobu starts
Screenshots
See top
Additional context
I believe there's no ability to su -c byobu $NB_USER
or anything similar due to escalation as jovyan
Reproduced the issue on a dev notebook.
Trying to confirm if it is a filesystem operation that's being blocked as suggested by the error message.
Also will take a look at how it's being installed on the image, maybe there's an alternative way to install it.
Noticed that the executable byobu is actually a shell script that implements a configuration layer on top of tmux or screen, which are the actual screen managers. So I didn't need to debug with strace, I could just inspect the script. Here's a section relevant to this issue:
# All sorts of things go wrong if you don't own your $HOME dir.
# This happens under sudo, if you don't use the -H option; Byobu will
# create a bunch of files in your $HOME which will be owned by root.
if [ ! -O "$HOME" ]; then
echo "Cannot run $PKG because [$USER] does not own [$HOME]" 1>&2
if [ -n "$SUDO_USER" ]; then
echo "To run $PKG under sudo, you MUST use 'sudo -H'" 1>&2
fi
exit 1
fi
I created a branch and added a directive in the ∞_CMD.Dockerfile docker-bits file to change the ownership from root to user.
I will create a notebook based on the branch image and verify if byobu startup error gets resolved.
I created the notebook and verified that changing ownership of user's home directory from root to user makes byobu work.