40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  40m Log  Not logged in ELOG logo
Entry  Wed Mar 7 13:59:07 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
    Reply  Wed Mar 7 18:00:39 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
       Reply  Thu Mar 8 17:18:19 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
          Reply  Fri Mar 9 11:02:56 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
             Reply  Fri Mar 9 15:48:56 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
                Reply  Fri Mar 9 16:28:10 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
          Reply  Mon Jul 23 07:39:55 2012, Ryan Fisher, Summary, Computer Scripts / Programs, Alterations to base epics install for installing aLIGO conlog: 
Message ID: 6387     Entry time: Thu Mar 8 17:18:19 2012     In reply to: 6377     Reply to this: 6391   7001
Author: Ryan Fisher 
Type: Summary 
Category: Computer Scripts / Programs 
Subject: Alterations to base epics install for installing aLIGO conlog: 
I have the aLIGO Conlog 'working' at http://192.168.113.209/conlog/conlog.php

The process is running inside a screen on megatron.

To start it running, you need to set your environment, and then run the startup.c1conlog script :

cd /cvs/cds/rtcds/caltech/c1/target/conlog/conlogepics

source conlog_environment.txt

./startup.c1conlog

This will leave you at an epics prompt, which means the code is running. (that's why I left it running in a screen for now).

To change the list of channels when the conlog is running, you need to edit the file (s):

/ligo/caltech/data/conlog/c1/add_channel_names
/ligo/caltech/data/conlog/c1/remove_channel_names

Then start up medm as follows:

cd ~/ryan/

medm -x -macro "IFO=C1" medm/CONLOG.adl

Then click the Add channel list button or Remove channel list button.

To change the channels before running the conlog from a blank database, you would edit:
/ligo/caltech/data/conlog/c1/use_channel_names (I believe this should be read whenever the conlog is restarted, but I'm only sure it does the first time you start conlog).




Documenting the rest of the installation:


Successful? Installation of Fresh EPICS and Extensions



Fresh Copy of EPICS 3.14.10


* We restarted (on Patrick's suggestion) with a fresh copy of EPICS 3.14.10 in:
/ligo/apps/linux-x86_64/epics
* I had to set a clean environment:
* Then I downloaded the tarball, unpacked it, and simply ran make within it, and it worked!
* Next, I followed Patrick's wiki instructions with only modifications to the configure/RELEASE files for the archive and ioc/conlog extensions.
* Then I realized that I had to rebuild conlog ioc after adding a directory:
/ligo/apps/linux-x86_64/epics/iocs/conlog/iocBoot/iocc1_conlog
* I had to copy the files from the h1 directory and modify them so that all reference to h1 now point to c1 in the new directory
* I then rebuilt the conlog ioc (I had to make sure setenv SCRIPTS was run again because I had logged out and back in, and I reset the whole environment properly again)

Rest of Install


* I was able to fairly trivially follow through the rest of the installation steps on Patrick's wiki, up to the "Design" section.
* Now, there is no obvious way to move forward (nothing is actually running I believe).

New Install Instructions:


"
You want to create the EPICS IOC boot directory by doing the following:

In the top level of the IOC (.../epics/iocs/conlog) with the appropriate
paths:

/epics/base/bin/linux-x86_64/makeBaseApp.pl -i -t ioc c1_conlog
What application should the IOC(s) boot?
The default uses the IOC's name, even if not listed above.
Application name? conlog

Then you will have to update the st.cmd it creates. You can compare the
st.cmd and st.cmd.backup files in the other directories to see what needs
to be changed.

I don't know if just copying the directory will work, it might.

You will also probably want to change the following line in
/epics/modules/archive/archiveApp/src/drvArchive.c:

queue = epicsMessageQueueCreate(100000000, sizeof(struct message_type));

and reduce 100000000 to something smaller depending on the amount of ram
available to the computer. I think sizeof(struct message_type) is
something like 112 bytes. Then recompile.

You basically put a file with the list of channels to use in the directory
path for "use channel list filepath" in the following command in st.cmd:
drvArchive_read_channel_list_filepaths <add channel list filepath>,<remove
channel list filepath>,<use channel list filepath>
I can send you the script that I currently use to generate that channel
list if you want, but it may need to be changed for your setup.

Once you start the ioc, open the medm which can be checked out from
subversion here: cds_user_apps/trunk/cds/common/medm/CONLOG.adl
with macro substitution for IFO: medm -x -macro "IFO=C1"
and click on the button for "Use channel list".
The number of monitored channels should increase to the number of channels
in the file.

-Patrick

...

The perl script and example file are attached, just redirect the output of
the perl script to a file. It scans autoBurt.req files in a particular
directory and its subdirectories for channel names that meet certain
criteria. All the file contains is a list of channel names, one on each
line. To start the IOC, go to the target directory and run
./startup.c1conlog.

"

{{rpfisher:scan_autoburt.pl.txt|scan_autoburt.pl.txt}}



{{rpfisher:use_channel_names.txt|use_channel_names.txt}}



My Notes Regarding These Instructions:


* Throughout the installation instructions, it probably should have been made clear that the ifo is lowercase: eg c1 (but in the end the installation mixed C1 and c1 in different places)
* Also throughout, one should be careful to replace lho with your site (eg caltech) wherever it appears
* After running the first perl script to generate the iocBoot/iocc1_conlog directory, the goal is to rebuild the whole conlog ioc by running make from epics/iocs/conlog, but before doing that:
* I needed to change the suggested line in the archive module to match the correct RAM size of the machine I am installing on (I actually gave it just less than half the free RAM), then:
* Remake the archive module
* Change into the ioc/conlog directory, remove the iocBoot I had made before for c1, rerun the perl script above, then run make from the ioc/conlog directory.
* Once that is done, you need to edit the file st.cmd to add lines for the reading and writing of channels, such as:
dbLoadRecords("db/conlog.db","IFO=C1")
drvArchive_mysql "C1_conlog","/data/mysql/C1_conlog_epics_user"
drvArchive_read_channel_list_filepaths "/ligo/caltech/data/conlog/c1/add_channel_names","/ligo/caltech/data/conlog/c1/remove_channel_names","/ligo/caltech/data/conlog/c1/use_channel_names"
drvArchive_write_channel_list_filepaths "/ligo/caltech/data/conlog/c1/channel_names","/ligo/caltech/data/conlog/c1/monitored_channel_names","/ligo/caltech/data/conlog/c1/unmonitored_channel_names"
* I also had to rerun this set of commands once that was all done:
controls: cd /opt/rtcds/<site>/<ifo>/target/conlog/conlogepics
controls: cp -r /ligo/apps/linux-x86_64/epics/iocs/conlog/db ./
controls: cp -r /ligo/apps/linux-x86_64/epics/iocs/conlog/dbd ./
controls: cp /ligo/apps/linux-x86_64/epics/iocs/conlog/iocBoot/ioc<ifo>_conlog/envPaths ./
controls: cp /ligo/apps/linux-x86_64/epics/iocs/conlog/iocBoot/ioc<ifo>_conlog/st.cmd ./
controls: echo ./bin/linux-x86_64/conlog st.cmd > startup.<ifo>conlog
controls: chmod a+x startup.<ifo>conlog
* This set of instructions seemed to be lacking, so I added this:

cp -r /ligo/apps/linux-x86_64/epics/iocs/conlog/bin/ ./

* Now the executable runs but doesn't work:
* Fixes needed:
* Need to use root permissions and make sure the files in /data/mysql have the right names for the users the code expects and also have the right passwords. (have to match capitalization appropriately for the <ifo> tag everywhere
* Might need to go into mysql and add a new user with the proper capitalization also
* Need to edit the ld_library_path to point to the new epics libraries (see the suggested environment below)
* Now, the code seems to work, but dumps me at an "epics> " prompt, I'm asking Patrick what to do next.
* I was impatient and loaded up the medm screen, and found out that the one channel I had picked was not readable (unmonitored)
* I ran a modified version of Patrick's perl script to search autoBert files for channels, and replaced my use_channel_names file with the output of the script
* Now, the medm screen shows lots of monitored channels, and the conlog is filling up! (can see it from phpmyadmin)
* Next step: I wanted to get the php pages working, so I edited the files inside /var/www/conlog:
megatron:~/ryan>diff -u /var/www/conlog/conlog.php /var/www/conlog/conlog.php.bck.Mar82012_1
--- /var/www/conlog/conlog.php  2012-03-08 15:31:53.152547771 -0800
+++ /var/www/conlog/conlog.php.bck.Mar82012_1   2012-03-08 15:28:23.062704171 -0800
@@ -19,7 +19,7 @@
        <form action="query.php" method="post">
                <h3><label for="database">Database:</label></h3>
                <select id="database" name="database">
-                       <option value="C1_conlog">C1</option>
+                       <option value="h2_conlog">h2</option>
                </select>
 
                <h3><label for="included_channels">Included channels:</label></h3>

megatron:~/ryan>diff -u /var/www/conlog/query.php /var/www/conlog/query.php.bck.Mar82012_1
--- /var/www/conlog/query.php   2012-03-08 15:33:45.122550303 -0800
+++ /var/www/conlog/query.php.bck.Mar82012_1    2012-03-08 15:32:31.772554679 -0800
@@ -168,8 +168,8 @@
        }
 
        $database_name = $_POST["database"];
-       if ($database_name == 'C1_conlog') {
-               $server = '192.168.113.209';
+       if ($database_name == 'h2_conlog') {
+               $server = 'cdsconlog';
        }
        else {
                die('Unknown database.');

* Finally, the mysql server was denying access from outside queries, so I fixed that:
megatron:~/ryan>diff -u /etc/mysql/my.cnf /etc/mysql/my.cnf.bck.Mar82012_1
--- /etc/mysql/my.cnf   2012-03-08 15:35:57.122548370 -0800
+++ /etc/mysql/my.cnf.bck.Mar82012_1    2012-03-08 15:35:10.652559315 -0800
@@ -49,7 +49,7 @@
 #
 # Instead of skip-networking the default is now to listen only on
 # localhost which is more compatible and is not less secure.
-#bind-address          = 127.0.0.1
+bind-address           = 127.0.0.1
 #
 # * Fine Tuning
 #
megatron:~/ryan>
* Now, I think everything is working * almost:
* It seems that when you first start the conlog up, it finds all the variables and inserts values of "Null" for everything, but after that it detects changes properly!


Conlog Environment


Need to source this to use the new environment:

megatron:~>cat ~/ryan/conlog_enviroment.txt
ELOG V3.1.3-