This commit is contained in:
@@ -62,9 +62,34 @@ Type "help", "copyright", "credits" or "license" for more information.
|
||||
|
||||
## Systemd Services
|
||||
|
||||
When ssh-ing into a machine, `/etc/profile.d/*` automatically gets sourced.
|
||||
When ssh-ing into a machine, `/etc/profile.d/*` automatically gets sourced. And thus we have:
|
||||
|
||||
```
|
||||
[sls-vserv-bd-hla01-dev ~]$ env | grep EPICS
|
||||
EPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062
|
||||
```
|
||||
|
||||
When running a `systemd` service, this does not happen.
|
||||
|
||||
Note -- it seems that the following does not work as expected:
|
||||
```
|
||||
That's why we need to source `/etc/profile.d/cas_12_epics.sh` in our startup script
|
||||
to make sure that `EPICS` is configured properly.
|
||||
to make sure that `EPICS` is configured properly.
|
||||
```
|
||||
After sourcing the script, we still have: `EPICS_CA_ADDR_LIST=` (i.e. the script does not set `EPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062`) in `systemd` service.
|
||||
|
||||
Whereas in the shell `unset EPICS_CA_ADDR_LIST` and then `. /etc/profile/cas_12_epics.sh` properly sets `EPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062`.
|
||||
|
||||
Check which env variables a `systemd` service is running with:
|
||||
|
||||
```
|
||||
[sls-vserv-bd-hla01-dev ~]$ systemctl --user restart AGEBD-SERVICE-SCRUBBING.service && sleep 1 && PID=$(systemctl --user show -p MainPID --value AGEBD-SERVICE-SCRUBBING.service)
|
||||
[sls-vserv-bd-hla01-dev ~]$ tr '\0' '\n' < /proc/$PID/environ | grep EPICS
|
||||
EPICS_CAS_IGNORE_ADDR_LIST=
|
||||
EPICS_CA_ADDR_LIST= 129.129.146.255
|
||||
EPICS_HOST_ARCH=linux-x86_64
|
||||
EPICS_BASE_HOST_BIN=/opt/gfa/python-3.10/20220602/epics/bin/linux-x86_64
|
||||
PYEPICS_LIBCA=/opt/gfa/python-3.10/20220602/epics/lib/linux-x86_64/libca.so
|
||||
EPICS_BASE_VERSION=7.0.5.0
|
||||
EPICS_BASE=/opt/gfa/python-3.10/20220602/epics
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user