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: How to run IOC in docker containers properly
From: Ben Franksen via Tech-talk <tech-talk at aps.anl.gov>
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Wed, 17 Jun 2020 15:01:43 +0200
Am 15.06.20 um 19:43 schrieb Johnson, Andrew N. via Tech-talk:
> On Jun 15, 2020, at 2:23 AM, xiao zhang via Tech-talk
> <tech-talk at aps.anl.gov<mailto:tech-talk at aps.anl.gov>> wrote:
> 
> The only way of starting an IOC I have learned is by running the
> `st.cmd` script, which by default opens an iocsh shell on success. I
> am seeing 2 problems when running IOCs in containers:
> 
> 1. The iocsh shell seems redundant as nobody will actually use it
> when run in containers. A way to start IOC which does not open up
> iocsh is a more light-weight solution.
> 
> I can’t help you with the container side at all, but it is possible
> to build an IOC that doesn’t start the IOC shell, or if you’re using
> one of the softIoc executables, tell that to not start the shell. In
> both cases though the IOC keeps its stdin, stdout and stderr streams
> open, and it will continue to send messages to stdout/stderr.
> 
> If you’re building your own application binary, you have to edit your
> <app>App/src/<app>Main.cpp file, remove the line iocsh(NULL) and
> replace the call to epicsExit(0) with a call to
> epicsThreadExitMain().
> 
> If you’re running the softIoc or softIocPVA executable from Base, you
> can pass that the flag -S (that’s an upper-case letter ’s’ to do the
> same thing as the above.
> 
> The result isn’t really any lighter-weight from the IOC’s perspective
> though, it just means you will have no ability to interact with the
> IOC while it’s running except through CA (or PVA). You can’t close
> stdin, send Control-C through it or use kill -QUIT to stop it, you
> have to use a kill -9 (SIGKILL) to make it die.

I can only agree with Andrew here and I would not recommend running an
IOC without any shell (it doesn't necessarily have to be the 'iocsh').

The standard method run run IOCs on a linux machine is to use provServ.
If configured properly, you can attach to the IOC console using a number
of standard interfaces (TCP port, UNIX domain socket). See 'man
procServ' for details.

Cheers
Ben

Attachment: signature.asc
Description: OpenPGP digital signature


Replies:
Re: How to run IOC in docker containers properly J. Lewis Muir via Tech-talk
References:
How to run IOC in docker containers properly xiao zhang via Tech-talk
Re: How to run IOC in docker containers properly Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: Multiple inputs in File Selector (Text Input widget Control System Studio) Adrian Martinez via Tech-talk
Next: Re: How to run IOC in docker containers properly J. Lewis Muir 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: How to run IOC in docker containers properly xiao zhang via Tech-talk
Next: Re: How to run IOC in docker containers properly J. Lewis Muir 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, 18 Jun 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·