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  <20152016  2017  2018  2019  2020  2021  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: procServ+devIocStats questions
From: "Kasemir, Kay" <[email protected]>
To: "[email protected]" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Wed, 25 Mar 2015 13:27:52 +0000
Hi:

On Mar 24, 2015, at 9:55 PM, Michael Davidsaver <[email protected]>
 wrote:
>> 1. What is the limit on the log file that procServ generates
>> and does
>> the ioc stop running through procServ if this limit gets exceeded?
> It keeps running (determined experimentally).

On Linux, adding the log files to the logrotate config should help to periodically shorten it.

>> 3. For pcaspy based iocs, it is fairly easy to exit the ioc by just
>> adding another PV to exit the python server, however I haven't found an
>> elegant way to restart the IOC  automatically similar to what procServ
>> does. Any suggestions?
> Run your python app in procServ?  It works for any process and is a
> handy way to daemon-ize programs which weren't designed with this in mind.

We structure our "python IOCs" like this:

Create pcaspy CA server,
create threads that to the actual work,
then end the program like this:

------------
# Maybe register some cleanup code
import atexit

def my_atexit():
	    logger.info("Exiting...")
	    ca_server.shutdown()
	    my_other_thread.shutdown()
	    my_other_thread.join()
	    print "Done."
	
atexit.register(my_atexit)

import code
code.interact(local=locals())
------------

Because of the code.interact(), the script remains in the python command-line.
When you now telnet to procserv, you can type commands in there.

To stop the 'real' IOCs as well as the python-based IOCs, we basically telnet to the procserv console and sent an "exit()\n".
This can be done interactively or via a web interface that was mentioned in recent tech talk messages.
For IOCs, just "exit\n" without the () would be sufficient, but for python it has to be "exit()\n", and luckily the IOC shell accepts that as well.

Depending on how you launched procserv, it will then stay in a "type ^X to restart" mode or automatically restart.

Thanks,
Kay



References:
procServ+devIocStats questions Alireza Panna
Re: procServ+devIocStats questions Michael Davidsaver

Navigate by Date:
Prev: RE: procServ+devIocStats questions freddie.akeroyd
Next: multiple asynRecord communication conflict Zohar, Sioan
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: procServ+devIocStats questions Michael Davidsaver
Next: RE: procServ+devIocStats questions freddie.akeroyd
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·