I'm trying to debug some login behaviour where I have both my display manager and systemd (and potentially others) altering some environment variables (the XDG_* variables). Does anyone know any way of logging which processes have set or unset an environment variable? My best guess so far is some LD_PRELOAD trick on setenv, unsetenv and putenv, but surely there's got to be a more obvious way? Thanks in advance.
stracethe relevant processes, or maybesysdigor such can log the callsstrace -fF -o /tmp/login.log -p $LOGIN_PROCESS_PID