All of lore.kernel.org
 help / color / mirror / Atom feed
* What is the best way to get Environment variables setup in my shell script for export PATH?
@ 2021-08-10  0:48 JH
  0 siblings, 0 replies; only message in thread
From: JH @ 2021-08-10  0:48 UTC (permalink / raw)
  To: yocto

Hi,

Please correct me, but I think the system environment set up in Yocto
Linux may not be the same as other distributions. I have a shell
script to set up export PATH and LD_LIBRARY_PATH, I want to avoid
putting full path in ExecStart and all of my shell scripts

ExecStart=my_measurement.sh

I have been thinking of the following options, but I am not sure which
one works, if the syntax is correct or not, which one is the best for
common practice, appreciate your advice.

(1) Setup in all systemd service scripts

[Service]
EnvironmentFile=/usr/bin/my_export.sh
ExecStart=my_measurement.sh

Is the syntax above statements in service scripts correct? Will it work?

(2) Add my_export.sh to /etc/profile.d

That one works for Ubuntu, Debian and CentOS, will all Yocto systemd
service scripts pick up environment setup from /etc/profile.d
automatically in Yocto Linux distribution?

(3) Add my_export.sh to /etc/default

Some distributions automatically pick setup from /etc/default, does it
work for Yocto Linux for systemd service scripts to pick up
my_export.sh setup from /etc/default?

Thank  you.

Kind regards,

- jupiter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-10  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10  0:48 What is the best way to get Environment variables setup in my shell script for export PATH? JH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.