Skip to content
Snippets Groups Projects
Commit b002277a authored by Wayne Lewis's avatar Wayne Lewis
Browse files

Change require PV prefix to use defined IOC name

Uses IOCNAME environment variable value if this is defined. This
makes the require PVs persistent across IOC restarts. Falls back
to the original definition of hostname and PID if the IOCNAME
environment variable is not defined.
parent 96b9ba54
No related branches found
No related tags found
No related merge requests found
...@@ -277,7 +277,7 @@ function iocsh_ps1 ...@@ -277,7 +277,7 @@ function iocsh_ps1
iocsh_ps1+="-"; iocsh_ps1+="-";
iocsh_ps1+=$pid; iocsh_ps1+=$pid;
iocsh_ps1+=" > "; iocsh_ps1+=" > ";
echo "${iocsh_ps1}" echo "${iocsh_ps1}"
}; };
...@@ -302,17 +302,23 @@ function require_ioc ...@@ -302,17 +302,23 @@ function require_ioc
# #define PVNAME_STRINGSZ 61 in EPICS_BASE/include/dbDefs.h # #define PVNAME_STRINGSZ 61 in EPICS_BASE/include/dbDefs.h
local require_ioc="" local require_ioc=""
local pid="$1";
# Keep only short hostname (without domain) # Test if IOCNAME is defined
local hostname=${HOSTNAME%%.*}; if [ -z "${IOCNAME}" ]; then
# Record name should not have . character, because it is used inside reacord local pid="$1";
# Keep only short hostname (without domain)
require_ioc="REQMOD"; # char 6 ( 6) local hostname=${HOSTNAME%%.*};
require_ioc+=":"; # char 1 ( 7) # Record name should not have . character, because it is used inside reacord
require_ioc+=${hostname:0:15}; # char 15 (22)
require_ioc+="-"; # char 1 (23) require_ioc="REQMOD"; # char 6 ( 6)
require_ioc+=${pid} # char 7 (30), max pid in 64 bit 4194304 (7), require_ioc+=":"; # char 1 ( 7)
require_ioc+=${hostname:0:15}; # char 15 (22)
require_ioc+="-"; # char 1 (23)
require_ioc+=${pid}; # char 7 (30), max pid in 64 bit 4194304 (7),
else
require_ioc=${IOCNAME:0:30};
fi
echo "${require_ioc}" echo "${require_ioc}"
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment