next up previous contents 5
Next: Installing and configuring the Up: Installation Previous: Installing DCSS   Contents

Configuring DCSS

After installing the DCSS program, it is necessary to create a valid database.dat file. Refer to maintaining database.dat for details on how to create and use this file. If you are just getting started and want to play with a simulation, an example database is available in text format. To use this file, follow the following steps:

  1. Copy the example dump file into the directory with the DCSS binary.

    blctlxx:/usr/local/dcs/dcss/linux > cp ../examples/example_bl111sim_dump.txt .

  2. Change the host names from which DCSS expects a hardware server to connect from.

    Using a text editor, change the host names to match the names of the computers on the new beam line. For example, the third line of a DHS entry may need to change to reflect the name of a DHS running on a different computer. If you plan to run the dhs on the same machine as DCSS, then you can use localhost as the hostname.

    simDhs
    3
    localhost 1
    

  3. Now load in the new dump file to create the database.dat memory mapped file:

    blctlxx:/usr/local/dcs/dcss/linux > ./dcss -r example_bl111sim_dump.txt
    
    ....<OUTPUT REMOVED>.........
    
    A total of 157 devices were read in from the dump file.
    blctlxx:/usr/local/dcs/dcss/linux >
    

  4. Copy the serverPorts.txt file from the examples directory into the /usr/local/dcs/dcss directory.

    blctlxx:/usr/local/dcs/dcss > cp ../examples/serverPorts.txt .

    The serverPorts.txt file is read by DCSS at start-up to determine what the listening ports are for the clients. The format is simply a single line of text for three different port numbers. The first port number is for the scripting engine to connect to. The second port number is for all of the hardware clients (DHS's) to connect to. The third port number is for all of the gui clients to connect to.

    This file could be added to the mysql database schema, but currently is not.

  5. If you are building DCSS on a non-linux computer, you may need to change the /usr/local/dcs/dcss/scripts/engine/scriptingEngine.tcl to reference the correct build directory for the tcl_clibs.so file, built previously.

    blctlxx:/usr/local/dcs/dcss/scripts/engine > grep tcl_clibs.so *.tcl
    scriptingEngine.tcl:load $DCSS_DIR/../../tcl_clibs/linux/tcl_clibs.so dcs_c_library
    

  6. Configure and/or install the mysql database as discussed in mysql Database .

  7. Make sure that the mysql database will allow the new machine to do an SQL "SELECT" from the appropriate tables in the beamline_configuration database:

    bl921:~ > /usr/local/mysql/bin/mysql -u admin -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 354856 to server version: 3.22.32
    
    Type 'help' for help.
    
    mysql> use beamline_configuration 
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> grant select on DCSS to dcss@blctlxx.slac.stanford.edu;
    Query OK, 0 rows affected (0.17 sec)
    
    mysql> grant select on Users to dcss@blctlxx.slac.stanford.edu;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.55 sec)
    
    mysql>
    

  8. Add an entry in the mysql database in the Beamlines table with the new beam line name. The id should be used in the next when adding the BeamlineID. This somehow seems redundant, but I remember it making sense at one point.

    mysql> select * from Beamlines where id=12;
    +----+-------+
    | id | Name  |
    +----+-------+
    | 12 | bl-xx |
    +----+-------+
    1 row in set (0.02 sec)
    

  9. Add an entry to the mysql database in the DCSS table. If this is the 12th beam line defined, then the result may look something like this. The DHS can use the ListeningPort and HostName of this table to find out where its DCSS is located.

    mysql> select * from DCSS where id=12;
    +----+---------------------------+---------------+---------------+------------+----------+
    | id | HostName                  | ListeningPort | MemoryMapFile | BeamlineID | beamline |
    +----+---------------------------+---------------+---------------+------------+----------+
    | 12 | blctlxx.slac.stanford.edu |         14242 | database.dat  |         12 | bl-xx    |
    +----+---------------------------+---------------+---------------+------------+----------+
    1 row in set (0.00 sec)
    

  10. Start DCSS in the /usr/local/dcs/dcss/linux directory. You may need to run DCSS as root, depending on authentication issues.

    blctlxx:/usr/local/dcs/dcss/linux > ./dcss -s


next up previous contents 5
Next: Installing and configuring the Up: Installation Previous: Installing DCSS   Contents
Scott McPhillips 2002-10-10