Skip to content
Snippets Groups Projects
Verified Commit 6e603451 authored by Olivier Benz's avatar Olivier Benz
Browse files

Reset default PATH settings for Zsh

- Export environment variables to /tmp/environment
parent 58701c87
No related branches found
No related tags found
No related merge requests found
Pipeline #30443 passed
......@@ -41,6 +41,10 @@ The following startup hooks are put in place:
* use binary packages according to environment variable `R_BINARY_PACKAGES`.
* [/usr/local/bin/before-notebook.d/30-code-server.sh](base/scripts/usr/local/bin/before-notebook.d/30-code-server.sh)
to update code-server settings.
* [/usr/local/bin/before-notebook.d/50-rstudio.sh](base/scripts/usr/local/bin/before-notebook.d/50-rstudio.sh) to
* set environment variables in `$(R RHOME)/etc/Renviron.site`.
* put inital RStudio settings in place.
* create user's working folder.
* [/usr/local/bin/before-notebook.d/70-qgis.sh](qgisprocess/scripts/usr/local/bin/before-notebook.d/70-qgis.sh) to
* put inital QGIS settings in place.
* copy plugin 'Processing Saga NextGen Provider'.
......@@ -55,6 +59,8 @@ The following startup hooks are put in place:
`NPROC_LIMIT`. (default: command `ulimit -u`)
* limit the number of *pending signals* according to environment variable
`SIGPEN_LIMIT`. (default: command `ulimit -i`)
* [/usr/local/bin/before-notebook.d/95-misc.sh](base/scripts/usr/local/bin/before-notebook.d/95-misc.sh)
to export environment variables to `/tmp/environment`.
### Custom scripts
......
# Reset default PATH settings
if [ "$(id -u)" -eq 0 ]; then
if [ "$(id -u)" -eq 0 ] || [ -n "$ZSH_VERSION" ]; then
PATH="/opt/code-server/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/opt/code-server/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
......
# /etc/zsh/zprofile: system-wide .zprofile file for zsh(1).
#
# This file is sourced only for login shells (i.e. shells
# invoked with "-" as the first character of argv[0], and
# shells invoked with the -l flag.)
#
# Global Order: zshenv, zprofile, zshrc, zlogin
. /etc/profile.d/00-reset-path.sh
#!/bin/bash
# Copyright (c) 2024 b-data GmbH.
# Distributed under the terms of the MIT License.
set -e
# Export environment variables to /tmp/environment
exclude_vars="HOME OLDPWD PWD SHLVL"
for var in $(compgen -e); do
[[ ! $exclude_vars =~ $var ]] && echo "$var=${!var}" \
>> "/tmp/environment"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment