1 | |
---|
2 | |
---|
3 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
5 | |
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
7 | <head> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
9 | |
---|
10 | <title>Installation Instructions for Pilatus Detectors — epicsdf v1.0 documentation</title> |
---|
11 | <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
---|
12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
---|
13 | <script type="text/javascript"> |
---|
14 | var DOCUMENTATION_OPTIONS = { |
---|
15 | URL_ROOT: '', |
---|
16 | VERSION: '1.0', |
---|
17 | COLLAPSE_INDEX: false, |
---|
18 | FILE_SUFFIX: '.html', |
---|
19 | HAS_SOURCE: true |
---|
20 | }; |
---|
21 | </script> |
---|
22 | <script type="text/javascript" src="_static/jquery.js"></script> |
---|
23 | <script type="text/javascript" src="_static/underscore.js"></script> |
---|
24 | <script type="text/javascript" src="_static/doctools.js"></script> |
---|
25 | <link rel="top" title="epicsdf v1.0 documentation" href="index.html" /> |
---|
26 | <link rel="up" title="Contents" href="contents.html" /> |
---|
27 | <link rel="next" title="EPICS IOC support documentation" href="epics/index.html" /> |
---|
28 | <link rel="prev" title="Contents" href="contents.html" /> |
---|
29 | </head> |
---|
30 | <body> |
---|
31 | <div class="related"> |
---|
32 | <h3>Navigation</h3> |
---|
33 | <ul> |
---|
34 | <li class="right" style="margin-right: 10px"> |
---|
35 | <a href="genindex.html" title="General Index" |
---|
36 | accesskey="I">index</a></li> |
---|
37 | <li class="right" > |
---|
38 | <a href="py-modindex.html" title="Python Module Index" |
---|
39 | >modules</a> |</li> |
---|
40 | <li class="right" > |
---|
41 | <a href="epics/index.html" title="EPICS IOC support documentation" |
---|
42 | accesskey="N">next</a> |</li> |
---|
43 | <li class="right" > |
---|
44 | <a href="contents.html" title="Contents" |
---|
45 | accesskey="P">previous</a> |</li> |
---|
46 | <li><a href="index.html">epicsdf v1.0 documentation</a> »</li> |
---|
47 | <li><a href="contents.html" accesskey="U">Contents</a> »</li> |
---|
48 | </ul> |
---|
49 | </div> |
---|
50 | <div class="sphinxsidebar"> |
---|
51 | <div class="sphinxsidebarwrapper"> |
---|
52 | <h3><a href="index.html">Table Of Contents</a></h3> |
---|
53 | <ul> |
---|
54 | <li><a class="reference internal" href="#">Installation Instructions for Pilatus Detectors</a><ul> |
---|
55 | <li><a class="reference internal" href="#install-epics-database-in-existing-ioc">Install EPICS database in existing IOC</a></li> |
---|
56 | <li><a class="reference internal" href="#install-gui-support">Install GUI support</a></li> |
---|
57 | <li><a class="reference internal" href="#install-enthought-python-distribution">Install Enthought Python Distribution</a><ul> |
---|
58 | <li><a class="reference internal" href="#test-pyepics">Test PyEPICS</a></li> |
---|
59 | </ul> |
---|
60 | </li> |
---|
61 | <li><a class="reference internal" href="#install-epicsdf-python-client-code">Install <tt class="docutils literal"><span class="pre">epicsdf</span></tt> Python client code</a><ul> |
---|
62 | <li><a class="reference internal" href="#test-epicsdf">Test epicsdf</a></li> |
---|
63 | <li><a class="reference internal" href="#configure-epicsdf">Configure <tt class="docutils literal"><span class="pre">epicsdf</span></tt></a></li> |
---|
64 | <li><a class="reference internal" href="#start-periodic-cron-task">Start periodic <tt class="docutils literal"><span class="pre">cron</span></tt> task</a></li> |
---|
65 | <li><a class="reference internal" href="#a-few-vi-editor-commands">a few VI editor commands</a></li> |
---|
66 | </ul> |
---|
67 | </li> |
---|
68 | </ul> |
---|
69 | </li> |
---|
70 | </ul> |
---|
71 | |
---|
72 | <h4>Previous topic</h4> |
---|
73 | <p class="topless"><a href="contents.html" |
---|
74 | title="previous chapter">Contents</a></p> |
---|
75 | <h4>Next topic</h4> |
---|
76 | <p class="topless"><a href="epics/index.html" |
---|
77 | title="next chapter">EPICS IOC support documentation</a></p> |
---|
78 | <h3>This Page</h3> |
---|
79 | <ul class="this-page-menu"> |
---|
80 | <li><a href="_sources/installation.txt" |
---|
81 | rel="nofollow">Show Source</a></li> |
---|
82 | </ul> |
---|
83 | <div id="searchbox" style="display: none"> |
---|
84 | <h3>Quick search</h3> |
---|
85 | <form class="search" action="search.html" method="get"> |
---|
86 | <input type="text" name="q" size="18" /> |
---|
87 | <input type="submit" value="Go" /> |
---|
88 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
89 | <input type="hidden" name="area" value="default" /> |
---|
90 | </form> |
---|
91 | <p class="searchtip" style="font-size: 90%"> |
---|
92 | Enter search terms or a module, class or function name. |
---|
93 | </p> |
---|
94 | </div> |
---|
95 | <script type="text/javascript">$('#searchbox').show(0);</script> |
---|
96 | </div> |
---|
97 | </div> |
---|
98 | |
---|
99 | <div class="document"> |
---|
100 | <div class="documentwrapper"> |
---|
101 | <div class="bodywrapper"> |
---|
102 | <div class="body"> |
---|
103 | |
---|
104 | <div class="section" id="installation-instructions-for-pilatus-detectors"> |
---|
105 | <h1>Installation Instructions for Pilatus Detectors<a class="headerlink" href="#installation-instructions-for-pilatus-detectors" title="Permalink to this headline">¶</a></h1> |
---|
106 | <p>There are several steps to the installation process. This page was written during the |
---|
107 | installation of this code at 15ID-D on the USAXS/SAXS Pilatus 100k detector. You might |
---|
108 | need to change some values to fit your situation.</p> |
---|
109 | <ol class="arabic simple"> |
---|
110 | <li>Install the EPICS database into an existing IOC.</li> |
---|
111 | <li>Install GUI support screens for MEDM or CSS-BOY</li> |
---|
112 | <li>Install Enthought Python Distribution with PyEPICS on Pilatus host computer.</li> |
---|
113 | <li>Install (and test and configure) <tt class="docutils literal"><span class="pre">epicsdf.py</span></tt> on Pilatus host computer.</li> |
---|
114 | <li>Start <tt class="docutils literal"><span class="pre">cron</span></tt> task to keep epicsdf.py running on Pilatus host computer.</li> |
---|
115 | </ol> |
---|
116 | <div class="section" id="install-epics-database-in-existing-ioc"> |
---|
117 | <h2>Install EPICS database in existing IOC<a class="headerlink" href="#install-epics-database-in-existing-ioc" title="Permalink to this headline">¶</a></h2> |
---|
118 | <p>These instructions assume the support database will run in an existing |
---|
119 | EPICS IOC. In this example, <tt class="docutils literal"><span class="pre"><TOP></span></tt> |
---|
120 | is the absolute directory path to the IOC’s top-level directory. |
---|
121 | In that directory, there will be some directory <em>someApp</em> where the source |
---|
122 | code for the IOC resides.</p> |
---|
123 | <ol class="arabic"> |
---|
124 | <li><p class="first">Check out support from subversion:</p> |
---|
125 | <div class="highlight-python"><pre>cd /tmp |
---|
126 | svn co https://subversion.xor.aps.anl.gov/bcdaext/epicsdf epicsdf |
---|
127 | cd epicsdf</pre> |
---|
128 | </div> |
---|
129 | </li> |
---|
130 | <li><p class="first">Copy support database to <tt class="docutils literal"><span class="pre"><TOP>/someApp/Db</span></tt> directory:</p> |
---|
131 | <div class="highlight-python"><pre>cd /net/s15dserv/xorApps/epics/synApps_5_4/ioc/15iddLAX/15iddLAXApp/Db |
---|
132 | cp /tmp/epicsdf/epics/epicsdf.db ./ |
---|
133 | svn add epicsdf.db |
---|
134 | svn propset svn:eol-style native epicsdf.db |
---|
135 | svn propset svn:keywords "Author Date Id Revision Url" epicsdf.db</pre> |
---|
136 | </div> |
---|
137 | </li> |
---|
138 | <li><p class="first">Copy autosave request file to <TOP>/iocBoot/iocNAME directory:</p> |
---|
139 | <div class="highlight-python"><pre>cd /net/s15dserv/xorApps/epics/synApps_5_4/ioc/15iddLAX/iocBoot/ioc15iddLAX |
---|
140 | cp /tmp/epicsdf/epics/epicsdf.req ./ |
---|
141 | svn add epicsdf.req |
---|
142 | svn propset svn:eol-style native epicsdf.req |
---|
143 | svn propset svn:keywords "Author Date Id Revision Url" epicsdf.req</pre> |
---|
144 | </div> |
---|
145 | </li> |
---|
146 | <li><p class="first">Call support database from <tt class="docutils literal"><span class="pre">st.cmd</span></tt> file (edit that file and add like this <em>before</em> <tt class="docutils literal"><span class="pre">iocInit</span></tt>):</p> |
---|
147 | <div class="highlight-python"><div class="highlight"><pre><span class="c"># 2011-08-01,PRJ</span> |
---|
148 | <span class="c"># database support for "df" command on Pilatus detector computer</span> |
---|
149 | <span class="c"># https://subversion.xor.aps.anl.gov/bcdaext/epicsdf/doc/build/html/index.html</span> |
---|
150 | <span class="n">dbLoadRecords</span><span class="p">(</span><span class="s">"$(TOP)/15iddLAXApp/Db/epicsdf.db"</span><span class="p">,</span> <span class="s">"P=15iddLAX:,D=p100k:"</span><span class="p">)</span> |
---|
151 | </pre></div> |
---|
152 | </div> |
---|
153 | </li> |
---|
154 | <li><p class="first">Register autosave request from <tt class="docutils literal"><span class="pre">auto_settings.req</span></tt> file (edit that file and add anywhere, usually at the end):</p> |
---|
155 | <div class="highlight-python"><pre># 2011-08-01,PRJ |
---|
156 | # database support for "df" command on Pilatus detector computer |
---|
157 | # https://subversion.xor.aps.anl.gov/bcdaext/epicsdf/doc/build/html/index.html |
---|
158 | file epicsdf.req P=$(P),D=p100k:</pre> |
---|
159 | </div> |
---|
160 | </li> |
---|
161 | </ol> |
---|
162 | <p>Keep the directory <tt class="docutils literal"><span class="pre">/tmp/epicsdf</span></tt> for use in the next step, to install the GUI support.</p> |
---|
163 | </div> |
---|
164 | <div class="section" id="install-gui-support"> |
---|
165 | <h2>Install GUI support<a class="headerlink" href="#install-gui-support" title="Permalink to this headline">¶</a></h2> |
---|
166 | <p>There are support screens for MEDM and CSS-BOY in the <tt class="docutils literal"><span class="pre">epics/</span></tt> |
---|
167 | subdirectory.</p> |
---|
168 | <ul class="simple"> |
---|
169 | <li><tt class="docutils literal"><span class="pre">epics/epicsdf.adl</span></tt> : MEDM screen, needs macros <tt class="docutils literal"><span class="pre">P</span></tt> and <tt class="docutils literal"><span class="pre">D</span></tt> defined</li> |
---|
170 | <li><tt class="docutils literal"><span class="pre">epics/epicsdf.opi</span></tt> : CSS-BOY screen, needs macros <tt class="docutils literal"><span class="pre">P</span></tt> and <tt class="docutils literal"><span class="pre">D</span></tt> defined</li> |
---|
171 | <li><tt class="docutils literal"><span class="pre">epics/starter.opi</span></tt> : CSS-BOY screen, defines <tt class="docutils literal"><span class="pre">P</span></tt> and <tt class="docutils literal"><span class="pre">D</span></tt> and calls <tt class="docutils literal"><span class="pre">epicsdf.opi</span></tt></li> |
---|
172 | </ul> |
---|
173 | <p>Copy these screens to the appropriate directory for the tool you use:</p> |
---|
174 | <div class="highlight-python"><pre>cd /net/s15dserv/xorApps/epics/synApps_5_4/ioc/15iddLAX/15iddLAXApp/op/adl |
---|
175 | cp /tmp/epicsdf/epics/epicsdf.adl ./ |
---|
176 | svn add epicsdf.adl</pre> |
---|
177 | </div> |
---|
178 | <p>The MEDM screen can be called from the command line with a command such as:</p> |
---|
179 | <div class="highlight-python"><pre>medm -x -macro P=15iddLAX:,D=p100k: epicsdf.adl &</pre> |
---|
180 | </div> |
---|
181 | <p>The directory <tt class="docutils literal"><span class="pre">/tmp/epicsdf</span></tt> can be discarded now.</p> |
---|
182 | </div> |
---|
183 | <div class="section" id="install-enthought-python-distribution"> |
---|
184 | <h2>Install Enthought Python Distribution<a class="headerlink" href="#install-enthought-python-distribution" title="Permalink to this headline">¶</a></h2> |
---|
185 | <table class="docutils field-list" frame="void" rules="none"> |
---|
186 | <col class="field-name" /> |
---|
187 | <col class="field-body" /> |
---|
188 | <tbody valign="top"> |
---|
189 | <tr class="field"><th class="field-name">warning:</th><td class="field-body">Procedure to install PyEPICS is flawed. |
---|
190 | On Linux, fails to find libCom.so.3.14... |
---|
191 | Works when matching libCom.so.(ver.sion) is copied to same place.</td> |
---|
192 | </tr> |
---|
193 | </tbody> |
---|
194 | </table> |
---|
195 | <p>These instructions describe installation of 32-bit support on the Pilatus host computer (usually SUSE Linux).</p> |
---|
196 | <ol class="arabic"> |
---|
197 | <li><p class="first">Copy deployment software to Pilatus host computer:</p> |
---|
198 | <div class="highlight-python"><pre>cd /tmp |
---|
199 | svn co https://subversion.xor.aps.anl.gov/bcdaext/epd_deployment epd_deployment |
---|
200 | cd epd_deployment |
---|
201 | mkdir images</pre> |
---|
202 | </div> |
---|
203 | </li> |
---|
204 | <li><p class="first">Copy Enthought installer to Pilatus host computer:</p> |
---|
205 | <div class="highlight-python"><pre>cp /APSshare/epd/downloads/epd-7.1-1-rh5-x86.sh ./images |
---|
206 | chmod +x ./images/epd-7.1-1-rh5-x86.sh</pre> |
---|
207 | </div> |
---|
208 | </li> |
---|
209 | <li><dl class="first docutils"> |
---|
210 | <dt>Check the installation script for valid paths against what is available on the Pilatus host computer.</dt> |
---|
211 | <dd><p class="first">There are several scripts. Here, just edit the macros in the 32-bit script</p> |
---|
212 | <ul class="simple"> |
---|
213 | <li><tt class="docutils literal"><span class="pre">install-rhel5-32.sh</span></tt>: installer shell script for 32-bit support</li> |
---|
214 | </ul> |
---|
215 | <table border="1" class="docutils"> |
---|
216 | <colgroup> |
---|
217 | <col width="19%" /> |
---|
218 | <col width="81%" /> |
---|
219 | </colgroup> |
---|
220 | <thead valign="bottom"> |
---|
221 | <tr><th class="head"><p class="first last">macro</p> |
---|
222 | </th> |
---|
223 | <th class="head"><p class="first last">meaning</p> |
---|
224 | </th> |
---|
225 | </tr> |
---|
226 | </thead> |
---|
227 | <tbody valign="top"> |
---|
228 | <tr><td><p class="first last"><tt class="docutils literal"><span class="pre">SRC</span></tt></p> |
---|
229 | </td> |
---|
230 | <td><p class="first last">relative path to the Enthought installer script</p> |
---|
231 | </td> |
---|
232 | </tr> |
---|
233 | <tr><td><p class="first last"><tt class="docutils literal"><span class="pre">LIBCA</span></tt></p> |
---|
234 | </td> |
---|
235 | <td><p class="first last">absolute path to EPICS <tt class="docutils literal"><span class="pre">libCa.so</span></tt> built for this OS</p> |
---|
236 | </td> |
---|
237 | </tr> |
---|
238 | <tr><td><p class="first last"><tt class="docutils literal"><span class="pre">EPD_ROOT</span></tt></p> |
---|
239 | </td> |
---|
240 | <td><p class="first last">absolute path under which this EPD will be installed</p> |
---|
241 | </td> |
---|
242 | </tr> |
---|
243 | </tbody> |
---|
244 | </table> |
---|
245 | <table class="last docutils field-list" frame="void" rules="none"> |
---|
246 | <col class="field-name" /> |
---|
247 | <col class="field-body" /> |
---|
248 | <tbody valign="top"> |
---|
249 | <tr class="field"><th class="field-name">note:</th><td class="field-body">Consider adding the path defined by <tt class="docutils literal"><span class="pre">${EPD_ROOT}/bin</span></tt> |
---|
250 | to the shell <tt class="docutils literal"><span class="pre">PATH</span></tt> variable.</td> |
---|
251 | </tr> |
---|
252 | <tr class="field"><th class="field-name">note:</th><td class="field-body">Suggest <tt class="docutils literal"><span class="pre">EPD_ROOT=/home/det/epd</span></tt> for Pilatus detectors. This makes |
---|
253 | the Python executable available at |
---|
254 | <tt class="docutils literal"><span class="pre">/home/det/epd/epd-7.1-1-rh5-x86/bin/python</span></tt></td> |
---|
255 | </tr> |
---|
256 | </tbody> |
---|
257 | </table> |
---|
258 | </dd> |
---|
259 | </dl> |
---|
260 | </li> |
---|
261 | <li><p class="first">Run installation script:</p> |
---|
262 | <div class="highlight-python"><pre>/bin/sh ./install-rhel5-32.sh</pre> |
---|
263 | </div> |
---|
264 | </li> |
---|
265 | </ol> |
---|
266 | <p>The directory <tt class="docutils literal"><span class="pre">/tmp/epd_deployment</span></tt> can be discarded now.</p> |
---|
267 | <div class="section" id="test-pyepics"> |
---|
268 | <h3>Test PyEPICS<a class="headerlink" href="#test-pyepics" title="Permalink to this headline">¶</a></h3> |
---|
269 | <p>Test the Python EPICS support (<a class="reference external" href="http://cars9.uchicago.edu/software/python/pyepics3/">PyEPICS</a>) |
---|
270 | by printing the APS storage ring current.</p> |
---|
271 | <div class="highlight-python"><pre>command_line> ${EPD_ROOT}/bin/python |
---|
272 | import epics |
---|
273 | print epics.caget('S:SRcurrentAI')</pre> |
---|
274 | </div> |
---|
275 | <p>This can be run as</p> |
---|
276 | <blockquote> |
---|
277 | <div>${EPD_ROOT}/bin/python test_pyepics.py</div></blockquote> |
---|
278 | <p>If this fails on the <tt class="docutils literal"><span class="pre">import</span> <span class="pre">epics</span></tt> statement, then the <tt class="docutils literal"><span class="pre">libCa.so</span></tt> module |
---|
279 | is probably not found.</p> |
---|
280 | </div> |
---|
281 | </div> |
---|
282 | <div class="section" id="install-epicsdf-python-client-code"> |
---|
283 | <h2>Install <tt class="docutils literal"><span class="pre">epicsdf</span></tt> Python client code<a class="headerlink" href="#install-epicsdf-python-client-code" title="Permalink to this headline">¶</a></h2> |
---|
284 | <ol class="arabic"> |
---|
285 | <li><p class="first">Check out support from subversion:</p> |
---|
286 | <div class="highlight-python"><pre>cd ~ |
---|
287 | svn co https://subversion.xor.aps.anl.gov/bcdaext/epicsdf epicsdf |
---|
288 | cd epicsdf</pre> |
---|
289 | </div> |
---|
290 | </li> |
---|
291 | <li><p class="first">Revise <tt class="docutils literal"><span class="pre">self.sender</span></tt> in <tt class="file docutils literal"><span class="pre">src/epicsdf.py</span></tt>. |
---|
292 | Specify the name of a valid APS email address as the sender. |
---|
293 | The <tt class="xref py py-meth docutils literal"><span class="pre">epicsdf.sendmail()</span></tt> |
---|
294 | sends mail using the <tt class="docutils literal"><span class="pre">mail</span></tt> program on the host operating system. By default, the |
---|
295 | Pilatus detectors are in the <tt class="docutils literal"><span class="pre">dectris.localdomain</span></tt> which is not allowed to send |
---|
296 | mail within the APS.</p> |
---|
297 | </li> |
---|
298 | </ol> |
---|
299 | <div class="section" id="test-epicsdf"> |
---|
300 | <h3>Test epicsdf<a class="headerlink" href="#test-epicsdf" title="Permalink to this headline">¶</a></h3> |
---|
301 | <dl class="docutils"> |
---|
302 | <dt>Try running the program directly. Note the program accepts a single PV prefix</dt> |
---|
303 | <dd><p class="first">as its argument (including the <tt class="docutils literal"><span class="pre">df:</span></tt>):</p> |
---|
304 | <div class="last highlight-python"><pre>/home/det/epd/epd-7.1-1-rh5-x86/bin/python src/epicsdf.py 15iddLAX:p100:df:</pre> |
---|
305 | </div> |
---|
306 | </dd> |
---|
307 | </dl> |
---|
308 | </div> |
---|
309 | <div class="section" id="configure-epicsdf"> |
---|
310 | <h3>Configure <tt class="docutils literal"><span class="pre">epicsdf</span></tt><a class="headerlink" href="#configure-epicsdf" title="Permalink to this headline">¶</a></h3> |
---|
311 | <dl class="docutils"> |
---|
312 | <dt>Verify that the starter shell script <tt class="docutils literal"><span class="pre">shell/epicsdf.sh</span></tt> works properly.</dt> |
---|
313 | <dd><p class="first">Move to the <tt class="docutils literal"><span class="pre">shell</span></tt> directory and edit both files. Adjust these items:</p> |
---|
314 | <table border="1" class="last docutils"> |
---|
315 | <colgroup> |
---|
316 | <col width="25%" /> |
---|
317 | <col width="75%" /> |
---|
318 | </colgroup> |
---|
319 | <thead valign="bottom"> |
---|
320 | <tr><th class="head">macro</th> |
---|
321 | <th class="head">example value</th> |
---|
322 | </tr> |
---|
323 | </thead> |
---|
324 | <tbody valign="top"> |
---|
325 | <tr><td>DATABASE_PREFIX</td> |
---|
326 | <td>15iddLAX:p100:df:</td> |
---|
327 | </tr> |
---|
328 | <tr><td>APP_BASE_DIR</td> |
---|
329 | <td>/home/det/epicsdf</td> |
---|
330 | </tr> |
---|
331 | <tr><td>PYTHON</td> |
---|
332 | <td>/home/det/epd/epd-7.1-1-rh5-x86/bin/python</td> |
---|
333 | </tr> |
---|
334 | </tbody> |
---|
335 | </table> |
---|
336 | </dd> |
---|
337 | </dl> |
---|
338 | <p>Test this by running each of these commands individually and looking at the output |
---|
339 | in the <tt class="docutils literal"><span class="pre">shell/epicsdf.log</span></tt> log file:</p> |
---|
340 | <div class="highlight-python"><pre>shell/epicsdf.sh start # should start the program |
---|
341 | shell/epicsdf.sh status # should say program is running |
---|
342 | shell/epicsdf.sh stop # should stop program |
---|
343 | shell/epicsdf.sh restart # should start program |
---|
344 | shell/epicsdf.sh restart # should stop and then start program |
---|
345 | shell/epicsdf.sh checkup # does nothing this time |
---|
346 | shell/epicsdf.sh stop # should stop program |
---|
347 | shell/epicsdf.sh checkup # should start program |
---|
348 | shell/epicsdf.sh checkup # does nothing this time</pre> |
---|
349 | </div> |
---|
350 | <p>For convenience, you could also (enter the <tt class="docutils literal"><span class="pre">shell</span></tt> directory and) |
---|
351 | type <tt class="docutils literal"><span class="pre">make</span> <span class="pre">start</span></tt>, <tt class="docutils literal"><span class="pre">make</span> <span class="pre">stop</span></tt>, ...</p> |
---|
352 | <p>Note: |
---|
353 | The first time <tt class="docutils literal"><span class="pre">shell/epicsdf.sh</span></tt> is run, the log file will contain some |
---|
354 | error information since the PID file has not yet been created. No problem |
---|
355 | for the first time. Maybe some additional code will be added to work around this. |
---|
356 | <strong>Ignore this error if it occurs the first time.</strong> You could even scrape it out |
---|
357 | of the log file.</p> |
---|
358 | <div class="highlight-python"><pre># ===== shell/epicsdf.sh start ===== Tue Aug 2 15:01:29 CDT 2011 ================================== |
---|
359 | /bin/cat: /home/det/epicsdf/shell/epicsdf.pid: No such file or directory |
---|
360 | ERROR: List of process IDs must follow -p. |
---|
361 | ********* simple selection ********* ********* selection by list ********* |
---|
362 | -A all processes -C by command name |
---|
363 | -N negate selection -G by real group ID (supports names) |
---|
364 | -a all w/ tty except session leaders -U by real user ID (supports names) |
---|
365 | -d all except session leaders -g by session OR by effective group name |
---|
366 | -e all processes -p by process ID |
---|
367 | T all processes on this terminal -s processes in the sessions given |
---|
368 | a all w/ tty, including other users -t by tty |
---|
369 | g OBSOLETE -- DO NOT USE -u by effective user ID (supports names) |
---|
370 | r only running processes U processes for specified users |
---|
371 | x processes w/o controlling ttys t by tty |
---|
372 | *********** output format ********** *********** long options *********** |
---|
373 | -o,o user-defined -f full --Group --User --pid --cols --ppid |
---|
374 | -j,j job control s signal --group --user --sid --rows --info |
---|
375 | -O,O preloaded -o v virtual memory --cumulative --format --deselect |
---|
376 | -l,l long u user-oriented --sort --tty --forest --version |
---|
377 | -F extra full X registers --heading --no-heading --context |
---|
378 | ********* misc options ********* |
---|
379 | -V,V show version L list format codes f ASCII art forest |
---|
380 | -m,m,-L,-T,H threads S children in sum -y change -l format |
---|
381 | -M,Z security data c true command name -c scheduling class |
---|
382 | -w,w wide output n numeric WCHAN,UID -H process hierarchy |
---|
383 | # started 9233: /home/det/epd/epd-7.1-1-rh5-x86/bin/python /home/det/epicsdf/src/epicsdf.py 15iddLAX:p100:df:</pre> |
---|
384 | </div> |
---|
385 | </div> |
---|
386 | <div class="section" id="start-periodic-cron-task"> |
---|
387 | <h3>Start periodic <tt class="docutils literal"><span class="pre">cron</span></tt> task<a class="headerlink" href="#start-periodic-cron-task" title="Permalink to this headline">¶</a></h3> |
---|
388 | <p>To ensure that the Python client program is restarted wfter a host reboot |
---|
389 | (or some other reason it has stopped), a periodic cron task checks that |
---|
390 | there is a PID running on the system and that PID is our python job. This |
---|
391 | is done by periodically calling:</p> |
---|
392 | <div class="highlight-python"><pre>epics/epicsdf.sh checkup</pre> |
---|
393 | </div> |
---|
394 | <p>which will start a new client program if it is not running. |
---|
395 | The <tt class="docutils literal"><span class="pre">cron</span></tt> task is started by:</p> |
---|
396 | <div class="highlight-python"><div class="highlight"><pre><span class="n">crontab</span> <span class="o">-</span><span class="n">e</span> |
---|
397 | </pre></div> |
---|
398 | </div> |
---|
399 | <table class="docutils field-list" frame="void" rules="none"> |
---|
400 | <col class="field-name" /> |
---|
401 | <col class="field-body" /> |
---|
402 | <tbody valign="top"> |
---|
403 | <tr class="field"><th class="field-name">note:</th><td class="field-body">You will probably need to know how to use the <tt class="docutils literal"><span class="pre">vi</span></tt> editor. Good luck!</td> |
---|
404 | </tr> |
---|
405 | </tbody> |
---|
406 | </table> |
---|
407 | <p>Add these contents to the end of the list, save, and then quit the editor. |
---|
408 | (Runs a <em>checkup</em> every 5 minutes.):</p> |
---|
409 | <div class="highlight-python"><pre># cron task |
---|
410 | # epicsdf- |
---|
411 | # watch some local disk partition and report it to EPICS, |
---|
412 | # send emails if space runs low |
---|
413 | */5 * * * * /home/det/epicsdf/shell/epicsdf.sh checkup</pre> |
---|
414 | </div> |
---|
415 | </div> |
---|
416 | <div class="section" id="a-few-vi-editor-commands"> |
---|
417 | <h3>a few VI editor commands<a class="headerlink" href="#a-few-vi-editor-commands" title="Permalink to this headline">¶</a></h3> |
---|
418 | <p>These are the few VI editor commands to help you edit the <tt class="docutils literal"><span class="pre">cron</span></tt> task. |
---|
419 | The notation <tt class="docutils literal"><span class="pre">[esc]</span></tt> means to press the <em>escape</em> key. If you need more |
---|
420 | help, you need the manual.</p> |
---|
421 | <table border="1" class="docutils"> |
---|
422 | <colgroup> |
---|
423 | <col width="24%" /> |
---|
424 | <col width="76%" /> |
---|
425 | </colgroup> |
---|
426 | <thead valign="bottom"> |
---|
427 | <tr><th class="head">command</th> |
---|
428 | <th class="head">meaning</th> |
---|
429 | </tr> |
---|
430 | </thead> |
---|
431 | <tbody valign="top"> |
---|
432 | <tr><td>i</td> |
---|
433 | <td>start <em>insert</em> mode (so you can enter text)</td> |
---|
434 | </tr> |
---|
435 | <tr><td>[esc]</td> |
---|
436 | <td>leave insert mode</td> |
---|
437 | </tr> |
---|
438 | <tr><td>:w!</td> |
---|
439 | <td>save: write the contents back to the file |
---|
440 | but do not quit <tt class="docutils literal"><span class="pre">vi</span></tt> yet.</td> |
---|
441 | </tr> |
---|
442 | <tr><td>:q!</td> |
---|
443 | <td>quit: Leave the program. If you have not |
---|
444 | saved first with <tt class="docutils literal"><span class="pre">:w!</span></tt>, your changes |
---|
445 | will be lost – forever. |
---|
446 | This is how you do a <em>cancel - no save</em>.</td> |
---|
447 | </tr> |
---|
448 | <tr><td>ZZ</td> |
---|
449 | <td>save and quit</td> |
---|
450 | </tr> |
---|
451 | </tbody> |
---|
452 | </table> |
---|
453 | </div> |
---|
454 | </div> |
---|
455 | </div> |
---|
456 | |
---|
457 | |
---|
458 | </div> |
---|
459 | </div> |
---|
460 | </div> |
---|
461 | <div class="clearer"></div> |
---|
462 | </div> |
---|
463 | <div class="related"> |
---|
464 | <h3>Navigation</h3> |
---|
465 | <ul> |
---|
466 | <li class="right" style="margin-right: 10px"> |
---|
467 | <a href="genindex.html" title="General Index" |
---|
468 | >index</a></li> |
---|
469 | <li class="right" > |
---|
470 | <a href="py-modindex.html" title="Python Module Index" |
---|
471 | >modules</a> |</li> |
---|
472 | <li class="right" > |
---|
473 | <a href="epics/index.html" title="EPICS IOC support documentation" |
---|
474 | >next</a> |</li> |
---|
475 | <li class="right" > |
---|
476 | <a href="contents.html" title="Contents" |
---|
477 | >previous</a> |</li> |
---|
478 | <li><a href="index.html">epicsdf v1.0 documentation</a> »</li> |
---|
479 | <li><a href="contents.html" >Contents</a> »</li> |
---|
480 | </ul> |
---|
481 | </div> |
---|
482 | <div class="footer"> |
---|
483 | © Copyright 2011, Pete Jemian. |
---|
484 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. |
---|
485 | </div> |
---|
486 | </body> |
---|
487 | </html> |
---|