Physics E-log System Add New Logbook Procedure

This procedure assumes that the base of the E-log system is /var/www. It should work also for a different directory base by substituting the different directory base for /var/www in this procedure. The example new E-log logbook name in this procedure is spear3elog.

All commands are executed as a superuser (requesting this privilege previously by filling out a SCCS form):
sudo su

Create New Logbook Directory Tree

  1. . /var/www/elogbook/bin/elogenv.sh
  2. Enter mkelog to invoke the mkelog script and respond as follows (in brackets) to the prompts:
    1. Enter name for the new elogbook (no blanks)! [spear3]
    2. Logbook title <return> for spear3elog? [<return>]
    3. Folder creation period <return> for W (Y=year, M=month, W=week, D=day, 3=3 shifts/day)? [D]
    4. Logbook language <return> for en (en/de)? [<return>]
    5. Logbook title string (strftime(3C) format) <return> for %B %Y Week %V? [<return>]
    6. Use virtual printer <return> for yes (y/n)? [<return>]
      will create virtual printer queue: spear3log
    7. Start the logbook search service <return> for yes (y/n)? [<return>]
      will start the search service at the end of the installation
    8. Logbook date format (MM/dd/yyyy, yyyy-MM-dd, dd.MM.yyyy) <return> for MM/dd/yyyy? [<return>]
    9. Logbook frame color <return> for CCFFCC (6 digit hex RGB code)? [<return>]
    10. All needed information has been collected!
      Start installation and deployment <return> for yes (y/n)? [<return>]

       3. Check/Correct the link under /usr/tomcat/webapps for the new logbook.

           Ensure that it looks like following -

           lclselog -> /var/www/lclselog/jsp/      <<<<- Ensure that you have jsp/

          

Changing the Web Interface Day Data Folder Format from "dd.mm" to "mm.dd"

If it is desired to change the web interface day data folder format from "dd.mm" to "mm.dd", copy the /var/www/spear3elog/bin/cronjob.sh file on the physics-elog machine to the "base_directory"/"logbook_name"/bin directory on the machine where the new E-log logbook is being created.

Update the Root Crontab with the New Logbook Crontab Jobs

  1. cd /etc
  2. Save the existing root crontab:
  3. Make a copy of the existing root crontab:
  4. Edit /etc/crontab.root and add the following lines above the "#+ DO NOT EDIT BELOW THIS LINE" line (example is for the spear3elog logbook):
    #
    # SPEAR3elog
    0 0,4,8,12,16,20 * * * /var/www/spear3elog/bin/search-index update 2> /var/www/spear3elog/log/search-index-update.log
    0 0 * * * /var/www/spear3elog/bin/cronjob.sh >> /var/www/spear3elog/log/cronjob.log &
  5. Update the root crontab:

Move Logbook Data to New Logbook

There may be logbook data on another system that must be moved to the machine where the new E-log logbook is being created. Furthermore, it may be necessary to convert the logbook data from an older version of the DESY-style E-log system to the latest version of this system. One may determine whether data format conversion is necessary by comparing the format of an XML entry file on the machine containing the old data with the format of an XML entry on the machine where the new E-log logbook is being created. Also, after moving the data it may become apparent that the old entries are not being displayed correctly.

Convert Logbook Data (If Necessary)

If it is necessary to convert the logbook data from an older version of the DESY-style E-log system to the latest version of this system, one needs to write a conversion script. A Perl script has been written to convert the old format of spear3elog logbook entries from the old lclselog machine E-log system to the format of entries on the latest version of this system, on the physics-elog machine. This script is /mccelog/logxml/bin/convert_old_to_new_desy.pl on the mccelog machine, where there is a version of Perl supporting the XML Simple parser used by this script.

The general plan is to:

  1. Move the old E-log entries for the logbook to a staging area in the SCCS NFS toaster space area.
  2. Run the conversion script to convert the old format to the new format for each year of logbook entries in the staging area.
  3. Copy the converted logbook entries to the machine where the new E-log logbook is being created.

An example of the detailed steps is:

  1. Move the old E-log entries for the logbook to a staging area in the SCCS NFS toaster space area:
    1. Change directory to the staging area for this logbook. For example,
      • cd /nfs/slac/g/cd/esd/archiver/desy_elog/spear3elog/data
    2. Copy each year of logbook entries to the staging area. For example,
      • cp -r /elogroot/web/htdocs/spear3elog/data/2008 .
  2. Run the conversion script to convert the old format to the new format for each year of logbook entries in the staging area.
    1. ssh mccelog -l cddev
    2. cd /mccelog/logxml/bin
    3. Convert each year of logbook entries in the staging area. For example,
      • ./convert_old_to_new_desy.pl spear3 2008 1 2008 53
  3. Copy the converted logbook entries to the machine where the new E-log logbook is created.
    1. Logon to the machine where the new E-log logbook is created and use the "sudo su" command for superuser priviliges.
    2. Change directory to the data area for the logbook. For example,
      • cd /var/www/spear3elog/data
    3. Copy each year of logbook entries from the staging area. For example,
      • cp -r /nfs/slac/g/esd/archiver/desy_elog/spear3elog/data/2008 .

Move Uncoverted Logbook Data (If Necessary)

If there is logbook data on another system that must be moved to the machine where the new E-log logbook is being created and it is not necessary to convert the old logbook entries from one format to another, the procedure in this section may be used.

  1. Logon to the machine where the new E-log logbook is created and use the "sudo su" command for superuser priviliges.
  2. Change directory to the data area for the logbook. For example,
  3. Copy each year of logbook entries from the other system. For example,
  4. Run the script to update the directory tree on the new system:
    /var/www/spear3elog/bin/cronjob.sh

Create "lplisten" Processes for the New Logbook

  1. cd /etc/init.d
  2. Save the existing st.lplistenadm file:
  3. Edit /etc/init.d/st.lplistenadm to start and stop the lplisten processes as appropriate. Under the "start()" section, add commands such as "${CMDPATH} stop spear3elog" and "${CMDPATH} start spear3elog" to stop and start the lplisten processes (where CMDPATH=/var/www/elogbook/bin/lplistenadm, for example). Under the "stop()" section, add a command such as "${CMDPATH} stop spear3elog".
  4. On RHEL 5, we have a different POSIX standard. Original lplisten script breaks on RHEL-5. To fix this problem do following -

           cp -p /var/www/cathodeelog/lplisten /var/www/cathodeelog/lplisten.orig
           cp -p /var/www/facetelog/lplisten /var/www/cathodeelog/lplisten

  1. Invoke the following commands to test the modifications to the /etc/init.d/st.lplistenadm file:
  2. Verify that there are two lplisten processes for the new logbook by issuing the following command:
  3. Verify that lplisten and the printer pipe work correctly. After a command such as the following example, the echo text should appear as an E-log entry in the current shift of the newly created logbook (you must have logged on as a superuser with "sudo su" previously):

Create a Print Queue for the New Logbook

It is necessary to create a print queue for the new logbook and associate it with the UNIX named pipe created for the logbook as a result of creating the new logbook directory tree. Note carefully in the below procedure that the name of the logbook and the subdirectory for the logbook contains a "e" character before "log" (e.g., "spear3elog") and the name of the print queue and associated named pipe does not contain the "e" character before "log" (e.g., "spear3log").

  1. /usr/sbin/lpadmin -x spear3log
    This deletes any existing spear3log print queue information.
  2. /usr/sbin/lpadmin -p spear3log -E -v parallel:/var/www/spear3elog/spear3log \
    -D "Printer queue for the SPEAR3 Logbook"
    This creates an association between the newly created print queue and the named pipe /var/www/spear3elog/spear3log. This command assumes a Linux system.
    The following error message is returned and apparently can be ignored:
  3. The above command enters information into the /etc/cups/printers.conf file for the newly created print queue but does not completely fill in all of the correct information. Therefore, edit the /etc/cups/printers.conf file to make the new spear3log printer section look just like the existing printer section, if any. This will involve editing the "DeviceURI" line to look like the following, for example:
  4. Restart the cups service:
  5. Issue "system-config-printer" command on physics-elog and ensure that the newly created printer is "shared".
  6. Verify that E-log print queue works correctly. After a command such as the following example, the echo text should appear as an E-log entry in the current shift of the newly created logbook:

 

Create a Print Queue for the New Logbook on lcls-prod01 -

Logon to lcls-prod01 as root

Take a copy of /etc/printcap and /etc/cups directory

cd /etc
cp -p printcap printcap.06112012
tar -cvf cups06112012.tar cups

Using "system-config-printer" utility create new logbook printer.

Review existing printer configuration of printer physics-lclslog and mirror it's setting for the new printer.

i.e -

Printer Name - physics-lclslog

Select Connection -> LPD/LPR Host or Printer

Hostname -> physics-elog

Printer Name -> lslslog

Printer Model -> Raw

Ones the printer has been craeted enable it.

cupsenable physics-lclslog

Issues -

New created elog is not seen under Elogbookmanager URL "http://physics-elog.slac.stanford.edu/elogbookManager/"

Solution - In progress.... Need to check with Raimund...

1st Update -

Raumund's suggestion - When ever you add or delete an elog you need to reload the elogbookManager using the tomcat manager. After this the new elog should show up in the elogbookManager and from there you should than be able to use 'search' -> 'create new index' to create an initial index (you must have the directory tree - cathodeelog/work/index - created in advance!).

Result - After following Raimund's instructions, the new logbook started showing up under elogbookManager. But it says - This logbook is currently not managed. It may be outdated.

Raimund's update -

you used the 'old' style elogbook stuff (applet instead of javascript based navigation tree) as template for the cathodeelog - that's why the elogbookManager stated that it is an unmanaged elog!

 

I fixed that now for the cathodeelog - but you need to change the template to not get the same problem with the next elog you create!

What I did (and what therefore should be change in the template) is:

 

1. change the elog conf to get the manager recognize the elogbook:

        cd /var/www/cathodeelog/jsp/

        cp conf.xml conf.xml.orig

        vi conf.xml

(do a diff to see the changes)

2. Change the left frame to use the javascript tree instead of the applet stuff:

        cd /var/www/cathodeelog/jsp/

        cp left.jsp left.jsp.orig

        cp ../../lclselog/jsp/left.jsp .

 

that's it!

Now again:

1. reload elogbookManager in Tomcat manager 2. got to elogbookManager -> cathodeelog -> Tree -> create database -> reload

 

For the search I did:

1.      cd /var/www/cathodeelog/jsp/

        ../../elogbook/bin/create_keyword_list

(this needs - unfortunately - be done whenever you change the keywords of a elog) 2. got to elogbookManager -> cathodeelog -> Search -> create new index

 

Printer related issue - tiger.ps file not seen as a picture but appears as ascii file under newly created elogbook.

Solution - Following is done on "physics-elog" server.

/etc/init.d/st.lplistenadm stop

ps -ef | grep lplisten | grep -v grep

If you see any lplisten processes, kill those using kill command.

Copy proper lplisten executable for the newly created elog and then restart print queues.

cp -p /var/www/lclselog/lplisten  /var/www/lcls2elog/lplisten

/etc/init.d/st.lplistenadm  start

é voilà - all as it should be ;-)