EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Orderly IOC shutdown?
From: Andrew Johnson <[email protected]>
To: Michael Abbott <[email protected]>
Cc: [email protected]
Date: Mon, 26 Feb 2007 13:18:17 -0600
Hi Michael,

Michael Abbott wrote:
Is there any way to request the orderly shutdown of an IOC, waiting for all IOC threads to terminate (I'm guessing not).

Probably not in the way you're looking for. You can type 'exit' into the ioc shell which will stop the IOC, but you may not regard the resulting shutdown as 'orderly'.


I have a lot of resources open which I would like to close cleanly: but if IOC threads are still running then I have to synchronise with them to ensure closed resources aren't used by calls from IOC threads.

Am I better off just pulling the plug, leaving everything running and relying on exit to do the right thing?

I can (and do) shut my own threads down in an orderly fashion, but the IOC threads seem to be out of reach.

The problem is that the IOC extensibility mechanisms (record, device and driver support etc.) were designed before the idea of porting to non-vxWorks systems came up, and the original concept for the vxWorks systems was that they boot up on power up, and then they run until they get turned off. As a result there's nothing in the record support or device support interfaces to ask them to shut down nicely, and retro-fitting such an interface would be a major re-engineering effort (which we want to do anyway for other reasons too, but the results cannot be backwards-compatible and it's hard for APS to justify spending effort on such work). We already know that the internal CA client that handles links has issues with IOC shutdown; I think there's 'string and sealing wax' in that code to try and be as tidy as possible, but it's not great.


You can use the epicsAtExit() facility to get callbacks when shutdown is occurring, but the current state of the other threads when this happens is not well-defined, meaning your I/O thread may be active at the time and there's nothing we can do about that.

I'm running an EPICS 3.14 IOC as a Linux process, using iocsh(filename) to load databases and get things rolling, and then running as a daemon the rest of the time.

I hope you've heard of the GNU Screens program, which is a wonderful way of attaching to IOC consoles to provide simultaneous access to the console session, a history buffer and the ability to disconnect and reconnect at will. We use this for both soft and hard IOCs here.


- Andrew
--
The right to be heard does not automatically include
the right to be taken seriously. -- Hubert H. Humphrey

Replies:
Re: Orderly IOC shutdown? Ernest L. Williams Jr.
Re: Orderly IOC shutdown? Michael Abbott
References:
Orderly IOC shutdown? Michael Abbott

Navigate by Date:
Prev: Orderly IOC shutdown? Michael Abbott
Next: Parker GV6K support? Russ Berg
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Orderly IOC shutdown? Michael Abbott
Next: Re: Orderly IOC shutdown? Ernest L. Williams Jr.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·