EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] Re: CA_DISABLE_REPEATER Re: Killing caRepeater on Windows 10
From: "Kasemir, Kay via Tech-talk" <[email protected]>
To: "J. Lewis Muir" <[email protected]>
Cc: "'[email protected]'" <[email protected]>
Date: Tue, 14 Jan 2020 18:47:12 +0000
>  I'd love to have a way to disable the C implementation's automatic
> starting of the caRepeater process...
> ...not a big fan of the .. name, though...
> Perhaps a name like CA_REPEATER_AUTO_START would
> be better.

Right, the first question is the name.
How about EPICS_CA_REPEATER_AUTO_START=YES/NO?
Then into what version it should go.
Finally I'm not fluent in launchpad.
Below is a diff against `git clone --recursive -b 7.0 https://git.launchpad.net/epics-base base-7.0` to show how it could be implemented.

-Kay


diff --git a/modules/ca/src/client/CAref.html b/modules/ca/src/client/CAref.html
index 7b6ff14..10e3b84 100644
--- a/modules/ca/src/client/CAref.html
+++ b/modules/ca/src/client/CAref.html
@@ -666,6 +666,9 @@ registered themselves with the CA Repeater. If the CA Repeater is not already
 running on a workstation, then the "caRepeater" program must be in your path
 before using the CA client library for the first time.</p>
 
+<p>Setting EPICS_CA_REPEATER_AUTO_START=NO will disable this automatic start
+of the caRepeater.</p>
+
 <p>If a host based IOC is run on the same workstation with standalone CA client
 processes, then it is probably best to start the caRepeater process when the
 workstation is booted. Otherwise it is possible for the standalone CA client
diff --git a/modules/ca/src/client/udpiiu.cpp b/modules/ca/src/client/udpiiu.cpp
index fe15f1b..5ff5f21 100644
--- a/modules/ca/src/client/udpiiu.cpp
+++ b/modules/ca/src/client/udpiiu.cpp
@@ -581,6 +581,15 @@ void epicsShareAPI caRepeaterRegistrationMessage (
  */
 void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
 {
+    // Do not auto-start if EPICS_CA_REPEATER_AUTO_START=NO
+    if ( envGetConfigParamPtr ( & EPICS_CA_REPEATER_AUTO_START ) ) {
+        int do_start = 1;
+        long longStatus = envGetBoolConfigParam (
+            & EPICS_CA_REPEATER_AUTO_START, & do_start );
+        if ( ! longStatus  &&   ! do_start )
+            return;
+    }
+
     bool installed = false;
     int status;
     SOCKET tmpSock;
diff --git a/modules/libcom/src/env/envDefs.h b/modules/libcom/src/env/envDefs.h
index 2490702..41c8f4a 100644
--- a/modules/libcom/src/env/envDefs.h
+++ b/modules/libcom/src/env/envDefs.h
@@ -45,6 +45,7 @@ typedef struct envParam {
 epicsShareExtern const ENV_PARAM EPICS_CA_ADDR_LIST;
 epicsShareExtern const ENV_PARAM EPICS_CA_CONN_TMO;
 epicsShareExtern const ENV_PARAM EPICS_CA_AUTO_ADDR_LIST;
+epicsShareExtern const ENV_PARAM EPICS_CA_REPEATER_AUTO_START;
 epicsShareExtern const ENV_PARAM EPICS_CA_REPEATER_PORT;
 epicsShareExtern const ENV_PARAM EPICS_CA_SERVER_PORT;
 epicsShareExtern const ENV_PARAM EPICS_CA_MAX_ARRAY_BYTES;

References:
Killing caRepeater on Windows 10 Mark Rivers via Tech-talk
RE: Killing caRepeater on Windows 10 Bommannavar, Arun S. via Tech-talk
RE: Killing caRepeater on Windows 10 Bommannavar, Arun S. via Tech-talk
CA_DISABLE_REPEATER Re: Killing caRepeater on Windows 10 Kasemir, Kay via Tech-talk
Re: CA_DISABLE_REPEATER Re: Killing caRepeater on Windows 10 J. Lewis Muir via Tech-talk

Navigate by Date:
Prev: Re: Killing caRepeater on Windows 10 Matt Newville via Tech-talk
Next: RE: Killing caRepeater on Windows 10 Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: CA_DISABLE_REPEATER Re: Killing caRepeater on Windows 10 J. Lewis Muir via Tech-talk
Next: Re: Record for a running sum Donny Domagoj Cosic via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 14 Jan 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·