Environment variables : What happens when starting a kde konsole from application launcher

Hello.
In /etc/bash.bashrc.local, I set some system global env variables. I also defines some global definition functions that does not exists by default in bash. All these definitions aim to be available to all users in any bash script.
To prevent multiple source action, a readonly variable is used

if test -z "$SOURCED_SYS_COMMON_FUNC" ; then
	test -s /backup_sys/VAR/MY_ENV_VAR/zzzz2_system_common_func.sh  &&  . /backup_sys/VAR/MY_ENV_VAR/zzzz2_system_common_func.sh
	if [[ -z "$(LC_ALL=C type stop_or_continue 2>/dev/null)" ]] ; then
		MY_LOGGER2 "FATAL ERROR --- stop_or_continue function not defined --- COMMON FUNCTIONS NOT SOURCED : zzzz2_system_common_func.sh"  "0"
	else
		readonly SOURCED_SYS_COMMON_FUNC=true
		export SOURCED_SYS_COMMON_FUNC
	fi
else
    MY_LOGGER2 "COMMON FUNCTIONS ALREADY SOURCED : zzzz2_system_common_func.sh"  "5"
fi

When opening a kde konsole from application launcher, the function definitions are lost without any error message ( but the variables definitions are still present ).

What erases my function definitions.

Any help is welcome.

I wonder, how many times are you going to ask the same question over and over again …

Once more - you cannot upload your function definitions in systemd environment but you can upload your variable definitions.

1 Like

Until I got a real answer.

I am not using any systemd units.
This had worked for decade up to leap 15.4 and it does not worked any more. So opensuse break Bash properties.

But KDE started to use them.

My bash initialization files run as expected
On Debian
https://paste.opensuse.org/pastes/d470235b082a

On Fedora
https://paste.opensuse.org/pastes/09d314f3a619

On Ubuntu
https://paste.opensuse.org/pastes/747e5c245f9a

All using KDE desktop with X11.

I don’t think that KDE made something special for all linux distribution editors.

I therefore conclude that it was Opensuse that made changes between version 15.4 and 15.5 of leap.

It would be desirable to provide a bypass.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.