Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion etc/profile.d/99-linuxmuster-linuxclient7.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
scriptDir=$(/usr/sbin/linuxmuster-linuxclient7 get-constant scriptDir)
source $scriptDir/executeHookWithEnvFix.sh onLogin
tmpEnvFile=$(/usr/sbin/linuxmuster-linuxclient7 get-constant tmpEnvironmentFilePath)

rm -f $tmpEnvFile

LinuxmusterLinuxclient7EnvFixActive=1 PATH=$PATH:$scriptDir/env-fix $scriptDir/onLogin

. $tmpEnvFile
rm -f $tmpEnvFile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _apply(templatePath):
# never ever overwrite sssd.conf, this will lead to issues!
# sssd.conf is written by `realm join`!
if targetFilePath in constants.notTemplatableFiles:
logging.warning("Skipping forbidden file {}".format(targetFilePath))
logging.warning(f"Skipping forbidden file {targetFilePath}")
return True

# create target directory
Expand All @@ -61,7 +61,7 @@ def _apply(templatePath):
fileData = _stripComment(fileData)

# write config file
logging.debug("-> to {}".format(targetFilePath))
logging.debug(f"-> to {targetFilePath}")
with open(targetFilePath, 'w') as targetFile:
targetFile.write(fileData)

Expand Down
File renamed without changes.
File renamed without changes.

This file was deleted.

2 changes: 1 addition & 1 deletion wiki/Insights/Environment-workaround.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This client uses Python. This brings a major problem: In Python it is not possible to modify the environment of the parent process.
Because of this, hook scripts must use `lmn-export` and `lmn-unset` instead of `export` and `unset`.
These scripts write the environment variables to a temporary file in `~/.linuxmuster-linuxclient7-environment.sh` which is then sourced afterwards.
This only works for the `onLogin.d` hook / the `logon.sh` script and is achieved by sourcing the script `/usr/share/linuxmuster-linuxclient7/scripts/executeHookWithEnvFix.sh` in `/etc/profile.d/99-linuxmuster-linuxclient7.sh` which then calls the `onLogin` script and sources `~/.linuxmuster-linuxclient7-environment.sh` afterwards.
This only works for the `onLogin.d` hook / the `logon.sh` script and is achieved in `/etc/profile.d/99-linuxmuster-linuxclient7.sh` which calls the `onLogin` script and sources `~/.linuxmuster-linuxclient7-environment.sh` afterwards.
2 changes: 1 addition & 1 deletion wiki/Insights/Script-calling-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This file is placed there in adsso-setup via the template in `/usr/share/linuxmu
Pam_exec calls this script on login AND on logout. If it is a login our logout is determined by the `PAM_TYPE` environment variable.

### onLogin
This is called via `/usr/share/linuxmuster-linuxclient7/scripts/executeHookWithEnvFix.sh`, which is called by `/etc/profile.d/99-linuxmuster-linuxclient7.sh` The reason for this is the [environment workaround](Environment-workaround)
This is called via `/etc/profile.d/99-linuxmuster-linuxclient7.sh`. Please note the [environment workaround](Environment-workaround).

### onSessionStart
This is called via `/home/$user/.config/autostart`.
Expand Down