-
Notifications
You must be signed in to change notification settings - Fork 371
Add locale and other environment variables support for systemd service jupyterhub #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wqh17101
wants to merge
3
commits into
jupyterhub:main
Choose a base branch
from
wqh17101:add-locale-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.. _topic/env-var-for-tljh-service: | ||
|
||
=========================================================== | ||
Locale Setting & Other Environment Variables for Jupyterhub | ||
=========================================================== | ||
|
||
Sometimes you need to run TLJH in the other language environment rather than English. | ||
This will cause some unexpected problems. | ||
|
||
e.g. | ||
|
||
- The file whose name is not English can not display properly | ||
- Can not open or create the file whose name is not English | ||
|
||
|
||
| You may find that no matter what you set in the shell,you will find that the locale is right in the shell only. And in the jupyter notebook/lab which is spawned by TLJH nothing has been changed. | ||
|
||
*The reason is that TLJH starts jupyterhub as a systemed service.* | ||
|
||
*As a systemed service unit, its environment variables should be set in its config.* | ||
|
||
|
||
So , we provide a convenient way to set the locale or other environment variables for the service. | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
We will create a config ``environment_for_system_service.conf`` in the ``/srv/src/tljh`` when the installer is running. | ||
You can add or modify any environment variables in it. | ||
|
||
e.g. | ||
|
||
.. code-block:: bash | ||
|
||
LANG=zh_CN.UTF-8 | ||
|
||
**Notice that before you modify the language setting in the conf , install the related fonts and packages first.** | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
|
||
After you do some changes , you should use | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. code-block:: bash | ||
|
||
systemctl daemon-reload | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
to reload jupyterhub.service`s config. | ||
|
||
and | ||
|
||
.. code-block:: bash | ||
|
||
sudo tljh reload hub | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
to reload tljh. | ||
|
||
**You should mention that everything set in ``environment_for_system_service.conf`` is only for the ``jupyterhub.service`` .** | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
It means that you`d better just add the environment variables which the jupyterhub needs instead of all the environment variables in your environment. | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.