next up previous contents 5
Next: Starting and Stopping DCSS Up: Configuring DCSS Previous: Configuring the beam line   Contents


Configuring the mysql User permissions tables

DCSS uses the mysql database to determine which users are allowed to user the beam line.

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

  2. 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;
    mysql> grant select on Users to dcss@blctlxx.slac.stanford.edu;
    mysql> grant select on Beamlines to dcss@blctlxx.slac.stanford.edu;
    Query OK, 0 rows affected (0.17 sec)
    
    mysql> flush privileges;
    Query OK, 0 rows affected (0.55 sec)
    
    mysql>
    

  3. 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.

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

  4. 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)
    

    Note: The ListeningPort entry in this not used by DCSS, because DCSS gets its port assignments from the 'serverPorts.txt' as described in configuring DCSS's server ports. However, the standard SSRL DHS actually does look into this table and grabs this value to determine which host and port it should connect to. Therefore, this Listening port should be the same value as the 'hardwarePort' as described in the serverPorts.txt file. Obviously there is some clean up needed here.

  5. Add an entry to the Users table for your account. The beamline field should either match the name of the beamline field in the DCSS table or the entry could be ALL, which would give the user access to all of the defined beamlines. The priv field is not used anymore and will be deleted in future release.

    mysql> select * from Users;
    +----+-----------+------+------------------+--------------+---------------+----------+-------+--------------+---------+
    | id | unix_name | priv | real_name        | office_phone | job_title     | beamline | staff | remoteAccess | enabled |
    +----+-----------+------+------------------+--------------+---------------+----------+-------+--------------+---------+
    |  1 | scottm    |    4 | Scott McPhillips | 9-714-xxxx   | S/W Developer | ALL      | y     | Y            | Y       |
    +----+-----------+------+------------------+--------------+---------------+----------+-------+--------------+---------+
    1 row in set (0.00 sec)
    


next up previous contents 5
Next: Starting and Stopping DCSS Up: Configuring DCSS Previous: Configuring the beam line   Contents
Scott McPhillips 2003-03-11