Hi,
my problems seems to be a little more tricky…I have a systemd-service, that runs under a system user, which is set as nologin-user (for safety reasons).
When I start the service, it receives a config file for the environment:
#Set the environment variables that GNU Health needs
EnvironmentFile=/etc/tryton/gnuhealthrc
How can I check that the service really uses the environment variables in that configfile?
systemctl status … does not give the right answers…
TIA!
It is not quite clear to me where you set that process environment variable. Putting the statement in a config file does not do much.What is done with that config file. In other words, what reads that config file and then executes that setting so that it is in the environment of a process and its offspring?
The env command prints the environment, thus
env | grep EnvironmentFile
will show if that variable is defined and what the value is of the current shell process where you are executing the env command. Of course it will then also be available to all child processes started from that shell.
I have no idea how I could get into the process that runs the service, in order to see the the env for that process.
The definitions in that rc file are:
test@linux-q6gm:~> more /etc/tryton/gnuhealthrc
alias cdlogs=‘cd /var/log/tryton’
alias cdexe=‘cd $(ls -d /usr/lib/python3.* )/site-packages/trytond’
alias cdconf=‘cd /etc/tryton’
alias cdmods=‘cd $(ls -d /usr/lib/python3.* )/site-packages/trytond/modules’
alias editconf=‘${EDITOR} /etc/tryton/trytond.conf’
alias cdutil=‘cd /usr/bin’
export GNUHEALTH_VERSION=3.4.0
Actually, the client should read the GNUHEALTH_VERSION from the server’s environment, but that seems to fail somehow. So, I’m checkeing step for step…
@malcolmlewis: sure, setting this in the service file would be an option (may do this for testing purposes).
For the moment, all the settings in the gnuhealthrc are copied from /etc/bash.bashrc.local , which is generated in the specfile during the build process. Subject to improvement, but first getting it running.
After some fiddeling I found that the entry in the configuration file is just
variable = value (and no EXPORT or similar like on the bash side of life)